I have a Visual Studio project, that's set up in TeamCity with a build-task to create artifacts via OctoPack (3.0.43). Next, a deploy-task, that receives the output NuGet-package from the build-task task (on successful build) as a dependency.
I've tried setting up the build-task using both the MsBuild
build-runner and the Visual Studio (sln)
one, but in both cases no artifacts are created.
I've added the OctoPack NuGet package to my Visual Studio project.
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 theInstall.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:This output the following:
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
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.