SharpeRAD / Cake.Powershell

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

Cake.Powershell possibly broken under Dotnet 6 #93

Open paulmilbank opened 2 years ago

paulmilbank commented 2 years ago
assembly 'Cake.Powershell, Version=1.0.1.0, Culture=neutral, PublicKeyToken=null' 

is referencing an older version of Cake.Core (1.0.0). 

For best compatibility it should target Cake.Core version 2.0.0.

Could not load D:\jenkins\workspace\Pushpay_Pushpay_PR-26486\tools\Addins\Cake.Powershell.1.0.1\lib\net5.0\Cake.Powershell.dll (missing System.Management.Automation, Version=7.1.2.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35)

powershell.exe : D:/jenkins/workspace/Pushpay_Pushpay_PR-26486/build.cake(78,5): error CS0103: The name 'StartPowershellFile' does not exist in the current context

At D:\jenkins\workspace\Pushpay_Pushpay_PR-26486@tmp\durable-625b7f48\powershellWrapper.ps1:3 char:1

I am also running into issues getting this going on a Mac locally. The Mac has Dotnet 6 installed too so my understanding is it will be trying to run under that runtime. My Mac has Powershell installed. I am running the build.ps1 bootstrap script under Powershell on the Mac.

./build.ps1 --target "Frontend Build"
Restore was successful.
Restore was successful.
Error: Failed to install addin 'Cake.Powershell'.

Running the 2.1.0 version of Cakebuild and the 1.01 version of the Cake.Powershell plugin.
The Build agent is running Server 2019 with VS2019 and VS2022 build tools. It will be running dotnet 6 when installing Cake tools and running the build script.

Please let me know if you need other info, I'm happy to provide further logs or answer questions to help get this resolved.

paulmilbank commented 2 years ago

The

assembly 'Cake.Powershell, Version=1.0.1.0, Culture=neutral, PublicKeyToken=null' 

is referencing an older version of Cake.Core (1.0.0). 

For best compatibility it should target Cake.Core version 2.0.0.

Seems to be a warning more than anything as the Yarn plugin has the same error but works fine.