SharpeRAD / Cake.Powershell

Powershell addin for Cake
http://cakebuild.net
MIT License
83 stars 36 forks source link

Could not load Microsoft.PowerShell.PackageManagement.dll (missing Microsoft.PackageManagement) when LoadDependencies option enabled #52

Closed sean-rose closed 6 years ago

sean-rose commented 6 years ago

Using the latest Cake.Powershell v0.4.4 with Cake v0.26.1 on Windows 10 x64 I got the following alert when running the script:

Could not load C:\...\tools\Addins\Microsoft.PowerShell.5.ReferenceAssemblies.1.1.0\lib\net4\Microsoft.PowerShell.PackageManagement.dll (missing Microsoft.PackageManagement, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35)

After downgrading to Cake.Powershell v0.4.3 and Cake v0.25.0 I don't get that alert.

sean-rose commented 6 years ago

After further testing, it appears this was probably caused by having Cake's LoadDependencies option enabled, causing it to download the dependent Microsoft.PowerShell.5.ReferenceAssemblies package and use the assemblies it contains, which are not strongly signed.

If so, it might be a good idea to add a note about that in the troubleshooting docs.

sean-rose commented 6 years ago

Come to think of it, the Microsoft.PowerShell.5.ReferenceAssemblies package seems like it's a development-only dependency, so that dependency could be removed from the generated Cake.Powershell package to avoid the possibility of this problem occurring altogether.

SharpeRAD commented 6 years ago

Should be resolved in v0.4.5