pnp / PnP-PowerShell

SharePoint PnP PowerShell CmdLets
https://pnp.github.io/powershell
Other
989 stars 662 forks source link

[BUG] Running PnP-Powershell in Azure, Could not load file or assembly 'System.Threading.Tasks.Extensions #2896

Open NicolasKheirallah opened 4 years ago

NicolasKheirallah commented 4 years ago

If you have a question and are not reporting a bug, please go to:

https://github.com/pnp/pnp-powershell/discussions

Reporting an Issue or Missing Feature

Bug in newest PnP

Expected behavior

Tested a older version (3.17) and it worked as it should, 3.25 doesn't

Actual behavior

2020-09-07T12:33:32.238 [Error] A ScriptHost error has occurred
2020-09-07T12:33:32.238 [Error] Could not load file or assembly 'System.Threading.Tasks.Extensions, Version=4.2.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51' or one of its dependencies. The system cannot find the file specified.
2020-09-07T12:33:32.300 [Error,ApplyPnPProvisioningTemplate] Exception while executing function: Functions.ApplyPnPProvisioningTemplate. System.Management.Automation: Could not load file or assembly 'System.Threading.Tasks.Extensions, Version=4.2.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51' or one of its dependencies. The system cannot find the file specified. mscorlib: Could not load file or assembly 'System.Threading.Tasks.Extensions, Version=4.2.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51' or one of its dependencies. The system cannot find the file specified.
2020-09-07T12:33:32.347 [Error,ApplyPnPProvisioningTemplate] Exception while executing function: Functions.ApplyPnPProvisioningTemplate
2020-09-07T12:33:32.347 [Error,ApplyPnPProvisioningTemplate] Could not load file or assembly 'System.Threading.Tasks.Extensions, Version=4.2.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51' or one of its dependencies. The system cannot find the file specified.
2020-09-07T12:33:32.378 [Error,ApplyPnPProvisioningTemplate] Function completed (Failure, Id=775374b4-d4c5-428b-8227-1ef27c02ddf7, Duration=5464ms)
2020-09-07T12:33:32.425 [Error,ApplyPnPProvisioningTemplate] Executed 'Functions.ApplyPnPProvisioningTemplate' (Failed, Id=775374b4-d4c5-428b-8227-1ef27c02ddf7)
2020-09-07T12:33:32.425 [Error,ApplyPnPProvisioningTemplate] Could not load file or assembly 'System.Threading.Tasks.Extensions, Version=4.2.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51' or one of its dependencies. The system cannot find the file specified.
2020-09-07T12:33:32.425 [Error,ApplyPnPProvisioningTemplate] Function had errors. See Azure WebJobs SDK dashboard for details. Instance ID is '775374b4-d4c5-428b-8227-1ef27c02ddf7'
2020-09-07T12:33:32.425 [Error,ApplyPnPProvisioningTemplate] Could not load file or assembly 'System.Threading.Tasks.Extensions, Version=4.2.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51' or one of its dependencies. The system cannot find the file specified.
2020-09-07T12:35:25  No new trace in the past 1 min(s).

Steps to reproduce behavior

1.Create an azure function for powershell 2.Create a folder called module under your function using kudu: "D:\home\site\wwwroot\ApplyPnPProvisioningTemplate\modules"

  1. Test your Azure Function and you will get the error above.

Which version of the PnP-PowerShell Cmdlets are you ?

What is the version of the Cmdlet module you are running?

(you can retrieve this by executing Get-Module -Name sharepointpnppowershell* -ListAvailable)

How did you install the PnP-PowerShell Cmdlets?

SnappyFPV commented 4 years ago

Same behavior here too

hittle08 commented 4 years ago

Same behavior here too, any updates on this?

Leif-Frederiksen commented 4 years ago

I see the same problem. 3.22.2006.0 worked for me but not 3.25.2009.1

hittle08 commented 4 years ago

Who at microsoft do I need to contact about this? I have a premium subscription with them and I keep getting bounced around between the SharePoint team, Azure Team, and Office 365 team.

NicolasKheirallah commented 4 years ago

PnP is a community project,I recommend you downgrade to 3.22.2006 for now

veniti commented 4 years ago

At 3.22.2006 my provisioning template is not set correctly. It works locally at 3.24 and 23.25 - but these versions won't go on Azure. Does anybody know if there's going to be an update soon?

Rob3r70 commented 4 years ago

Last one I was able to run in Azure is: 3.23.2007.0

MRoot21 commented 4 years ago

I just tried this for the first time today and got the same error...I am running 3.26.2010.0. Is there any fix other than running a lower version of PnP?