[BUG] Running PnP-Powershell in Azure, Could not load file or assembly 'System.Threading.Tasks.Extensions
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" 3. Test your Azure Function and you will get the error above.
Which version of the PnP-PowerShell Cmdlets are you ?
- [ ] PnP PowerShell for SharePoint 2013
- [ ] PnP PowerShell for SharePoint 2016
- [ ] PnP PowerShell for SharePoint 2019
- [X ] PnP PowerShell for SharePoint Online
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?
- [ ] MSI Installed downloaded from GitHub
- [X ] Installed through the PowerShell Gallery with Install-Module
- [X ] Other means
Same behavior here too
Same behavior here too, any updates on this?
I see the same problem. 3.22.2006.0 worked for me but not 3.25.2009.1
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.
PnP is a community project,I recommend you downgrade to 3.22.2006 for now
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?
Last one I was able to run in Azure is: 3.23.2007.0
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?