SharpeRAD/Cake.Services

"Could not load System.Management.Automation.dll" error message shown when addin loaded on Mac

Closed this issue · 1 comments

I have a cake script that we share between Mac and Windows computers, and there are a set of tasks for managing Windows Services (obviously only executed on Windows computers).

Annoyingly, though, just adding the #addin line for Cake.Services causes the following warning to be shown prominently before any other actions I execute when run on a Mac:

Could not load tools/Addins/Cake.Services.0.3.5/lib/net46/System.Management.Automation.dll (missing Microsoft.Management.Infrastructure, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35))

While I understand that this addin naturally expects to run only on Windows, I'm not aware of any way to conditionally run preprocessor directives in my cake script when run in Windows vs on a Mac. Is there any way I can keep these scripts functional when run on Windows without generating this prominent warning on Macs?

Closing as over a year old and not really an issue with the addon but rather a limitation of Cake.