pnp / pnpframework

PnP Framework is a .NET library targeting Microsoft 365 containing the PnP Provisioning engine and a ton of other useful extensions
https://pnp.github.io/pnpframework/
MIT License
205 stars 142 forks source link

Command Get-PnPSiteTemplate gets stuck and does not return any information/error #939

Open TiagoSantosOrbcom opened 10 months ago

TiagoSantosOrbcom commented 10 months ago

I have a internal website in my client which communicates with sharepoint via Microsoft.PowerShell.SDK, which means that the C# project is executing powershell comands. After updating all PowerShell Modules and Visual Studio Nugget Package, I started to notice a odd behavior from PnP.Framework Module.

When i tried to execute Command 1, the executions gets stuck in Log 1 and does return any error. After that, i tried a workaround and changed the extension of the file to .xml, as you can see in Command 2 and gave me the following error Log2.

This problem occurred 2 months ago when i updated Microsoft.Graph to version 5, but since then the problem has not been fixed. In my search for an answer, i found an old issue in 2021 that reported the same issue when executed Command 1.

Command 1:

Get-PnPSiteTemplate -Out C:\Temp\teste.pnp -PersistBrandingFiles -PersistPublishingFiles -ExcludeHandlers "SiteSecurity" -Force

Command 2:

Get-PnPSiteTemplate -Out C:\Temp\teste.xml -PersistBrandingFiles -PersistPublishingFiles -ExcludeHandlers "SiteSecurity" -Force

Log 1 image

Log 2

Unable to load one or more of the requested types.
Could not load type 'Microsoft.Graph.HttpProvider' from assembly 'Microsoft.Graph.Core, Version=3.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'.
Could not load type 'Microsoft.Graph.Group' from assembly 'Microsoft.Graph, Version=5.33.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'.
Could not load type 'Microsoft.Graph.IGraphServiceUsersCollectionPage' from assembly 'Microsoft.Graph, Version=5.33.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'.
Could not load type 'Microsoft.Graph.IGraphServiceUsersCollectionPage' from assembly 'Microsoft.Graph, Version=5.33.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'.
Could not load type 'Microsoft.Graph.IGraphServiceUsersCollectionPage' from assembly 'Microsoft.Graph, Version=5.33.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'.
Could not load type 'Microsoft.Graph.IGraphServiceUsersCollectionPage' from assembly 'Microsoft.Graph, Version=5.33.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'.
Could not load type 'Microsoft.Graph.IGraphServiceGroupsCollectionPage' from assembly 'Microsoft.Graph, Version=5.33.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'.
Could not load type 'Microsoft.Graph.IGroupMembersCollectionWithReferencesPage' from assembly 'Microsoft.Graph, Version=5.33.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'.
Could not load type 'Microsoft.Graph.IGraphServiceUsersCollectionPage' from assembly 'Microsoft.Graph, Version=5.33.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'.
Could not load type 'Microsoft.Graph.IGraphServiceUsersCollectionPage' from assembly 'Microsoft.Graph, Version=5.33.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'.
Could not load type 'Microsoft.Graph.IGroupOwnersCollectionWithReferencesPage' from assembly 'Microsoft.Graph, Version=5.33.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'.
Could not load type 'Microsoft.Graph.User' from assembly 'Microsoft.Graph, Version=5.33.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'.
Could not load type 'Microsoft.Graph.Group' from assembly 'Microsoft.Graph, Version=5.33.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'.
Could not load type 'Microsoft.Graph.Group' from assembly 'Microsoft.Graph, Version=5.33.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'.
Could not load type 'Microsoft.Graph.Group' from assembly 'Microsoft.Graph, Version=5.33.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'.
Could not load type 'Microsoft.Graph.Subscription' from assembly 'Microsoft.Graph, Version=5.33.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'.
Could not load type 'Microsoft.Graph.IGraphServiceSubscriptionsCollectionPage' from assembly 'Microsoft.Graph, Version=5.33.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'.
Could not load type 'Microsoft.Graph.Subscription' from assembly 'Microsoft.Graph, Version=5.33.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'.
Could not load type 'Microsoft.Graph.Subscription' from assembly 'Microsoft.Graph, Version=5.33.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'.
Could not load type 'Microsoft.Graph.Group' from assembly 'Microsoft.Graph, Version=5.33.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'.
Could not load type 'Microsoft.Graph.IGraphServiceGroupsCollectionPage' from assembly 'Microsoft.Graph, Version=5.33.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'.
Could not load type 'Microsoft.Graph.IGraphServiceGroupsCollectionPage' from assembly 'Microsoft.Graph, Version=5.33.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'.
Could not load type 'Microsoft.Graph.IGroupMembersCollectionWithReferencesPage' from assembly 'Microsoft.Graph, Version=5.33.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'.
Could not load type 'Microsoft.Graph.IGroupMembersCollectionWithReferencesPage' from assembly 'Microsoft.Graph, Version=5.33.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'.
Could not load type 'Microsoft.Graph.IGraphServiceUsersCollectionPage' from assembly 'Microsoft.Graph, Version=5.33.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'.
Could not load type 'Microsoft.Graph.IGraphServiceUsersCollectionPage' from assembly 'Microsoft.Graph, Version=5.33.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'.
Could not load type 'Microsoft.Graph.IGroupOwnersCollectionWithReferencesPage' from assembly 'Microsoft.Graph, Version=5.33.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'.
Could not load type 'Microsoft.Graph.User' from assembly 'Microsoft.Graph, Version=5.33.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'.
Could not load type 'Microsoft.Graph.Group' from assembly 'Microsoft.Graph, Version=5.33.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'.
Could not load type 'Microsoft.Graph.Group' from assembly 'Microsoft.Graph, Version=5.33.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'.
Could not load type 'Microsoft.Graph.IGraphServiceUsersCollectionPage' from assembly 'Microsoft.Graph, Version=5.33.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'.
Could not load type 'Microsoft.Graph.IUserDeltaCollectionPage' from assembly 'Microsoft.Graph, Version=5.33.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'.

Information

PowerShell Module Version
ExchangeOnlineManagement 3.2.0
Microsoft.Graph 2.8.0
PnP.PowerShell 2.2.0
PowerShellGet 2.2.5
Visual Studio Nugget Package Version
Microsoft.Grapg 5.33.0
Microsoft.IdentityModel 7.0.0
Microsoft.Kiota.Abstraction 1.6.1
Microsoft.PowerShell.SDK 7.3.4
PnP.Framework 1.13.126-nightly
System.Management.Automation 7.3.4
TiagoSantosOrbcom commented 9 months ago

There is any progress in this issue?

zapafta commented 8 months ago

Hi team!

Any new about this topic?

rsantosendiprev commented 4 weeks ago

Hi team!

Any new about this topic? Its crucial