Connect-ExchangeOnline stopped working between 5.3.3 and 5.4.4

Product: PowerShell Universal
Version: 5.4.4

Connect-ExchangeOnline, part of the ExchangeOnlineManagement module won’t connect any more in 5.4.4

I’ve updated ExchangeOnlineManagement module to latest version but problem persists.
I rolled back to 5.3.3 and it works without issue.

Anything I can do to get this running or is it going to need to wait for a fix?

I have the same issue, I had to make sure the script was running in integrated and couldnt use 5.1 or PS7 profiles

I wish there were a more permanent solution to the recurring issue of assembly version mismatch. I can recall this issue from UD times.

I opened an issue here. ExchangeOnline Module Not Loading · Issue #4592 · ironmansoftware/powershell-universal · GitHub

I also agree with trying to find a more permanent solution. I’ve considered some sort of module validation automation. We could do some sort of scan to of the PS Gallery for updates to popular modules, install them in PSU (maybe even a mix of them) and then do a couple operations to catch these basic failures. We could then publish the report so you could see which versions of which modules work with PSU.

Without this, it is a never-ending moving target on either end.

Looks like this started happening again with PSU 5.5.1

PS>TerminatingError(Add-Type): “Cannot add type. Compilation errors occurred.”
PS>TerminatingError(Get-ConnectionContext): “One or more errors occurred. (Could not load file or assembly ‘Microsoft.IdentityModel.Abstractions, Version=8.0.1.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35’. The located assembly’s manifest definition does not match the assembly reference. (0x80131040))”
PS>TerminatingError(): “Could not load file or assembly ‘Microsoft.IdentityModel.Abstractions, Version=8.0.1.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35’. The located assembly’s manifest definition does not match the assembly reference. (0x80131040)”
[ERROR] Failed to connect to Exchange Online: Could not load file or assembly ‘Microsoft.IdentityModel.Abstractions, Version=8.0.1.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35’. The located assembly’s manifest definition does not match the assembly reference. (0x80131040)

Removing ExchangeOnlineManagement module in PSU and installing it outside of PSU gives me a new error;

PS>TerminatingError(Add-Type): “Cannot add type. Compilation errors occurred.”

I was encountering the above error you mentioned, but none of my modules are installed via PSU. I prepped the server with all the dependencies of the scripts before I installed PSU. Using the integrated environment instead of the Powershell 7 environment managed to get the script to run. I’m not sure what that indicates about the problem though. I just upgraded from 2.9 to 5.5, so I’m still not super familiar with the new way the environments are being done.

I was able to install ExchangeOnlineManagement module outside of PSU in PS 5.1 then ran the scripts in PSU as PS 5.1 and its working. Doesn’t work with integrated or PS7 for me.