I am attempting to use Connect-PnPOnline (PnP.Powershell Module), which works in a normal Powershell window, and I am getting the below errorr:
Aug 25, 2021 4:45 PM [error] Could not load type ‘Microsoft.Extensions.Logging.Abstractions.Internal.NullScope’ from assembly ‘Microsoft.Extensions.Logging.Abstractions, Version=3.1.3.0, Culture=neutral, PublicKeyToken=adb9793829ddae60’.
I’m having trouble sorting out how to avoid what appears to be a dependency issue. Has anyone else encountered this?
Product: PowerShell Universal
Version: 2.2.1
Powershell 5.1 System Environment
I just ran into this same issue, upgraded to 2.3.1, and am still getting the same error with loading the DLL.
[error] Could not load type ‘Microsoft.Extensions.Logging.Abstractions.Internal.NullScope’ from assembly ‘Microsoft.Extensions.Logging.Abstractions, Version=3.1.3.0, Culture=neutral, PublicKeyToken=adb9793829ddae60’.
I tried running this in both the 5.1 and my 7.1.4 installed environments also. Both failed the same.
Alright. I have a fix for this in 2.4 and will likely merge back into 2.3 so I can put out 2.3.2 this week with this fix. It will also be in tonight’s nightly build.
The problem is there are assembly conflicts between the Pnp module and the assemblies that PowerShell Universal loads. We’ve tried to create a very minimal footprint of assemblies in PSU to avoid these kinds of problems but it’s tricky to avoid all of them. The reason this appeared fixed was that when running Connect-PnpOnline with one set of parameters would not yield this issue while running it with another set of parameters does.
That said, I have not extensively tested the PNP module and we may run into other issues with other cmdlets. It appears that it’s not going to work in the integrated environment due to the assembly conflicts.
Hi,
I’m currently experiencing a similar problem trying to deploy a Powershell script into Azure Functions.
Locally it works fine, but in Azure it doesn’t.
Could not load type 'Microsoft.Extensions.Logging.Abstractions.Internal.NullScope' from assembly 'Microsoft.Extensions.Logging.Abstractions, Version=3.0.3.0, Culture=neutral, PublicKeyToken=adb9793829ddae60'
PnP.PowerShell 1.11.0 → Newest Version doesn’t work either, locally all of them work fine
Powershell Version 7.2.6
Do I need to pick an older version of the PnP package or something?
Seems like Microsoft.Extensions.Logging.Abstractions, Version=3.0.3.0 is quite outdated.