Found this one out myself:
When I added OctoPack NuGet package, all seemed well. Hinted by various posts, I looked to the OctoPack.targets
file. Here I stumbled upon the Install.ps1
file, that seemed to be supposed to inject some build-actions in the VS project's .csproj file upon adding the NuGet package to project.
Next up, I removed the NuGet package and tried re-installing, but this time using the Package Management Console (View > Other Windows > Package Management Console
) with command:
Install-Package OctoPack
This output the following:
Successfully added 'OctoPack 3.0.43' to MySolution.MyProject. & :
File
C:\somepath\mysolution\packages\OctoPack.3.0.43\tools\Install.ps1
cannot be loaded because running scripts is disabled on this system.
For more information, see about_Execution_Policies at
http://go.microsoft.com/fwlink/?LinkID=135170. At line:1 char:3
So, some security stuff was preventing the PowerShell script to do its stuff with the .csproj file.
Solution:
In the same window (Package Management Console) or in an elevated PowerShell, execute
Set-ExecutionPolicy RemoteSigned
Retry NuGet package-installation (still same window or using the NuGet GUI) - now the NuGet package installer should inject whatever your version of OctoPack wants it to. After this, my TeamCity build started generating OctoPack artifacts correctly.