NuGet Installer build runner not installing packages correctly

When running the "NuGet Install" build runner, the "content" directory inside the Nuget dependency is not unpacked.  In the case of System.Data.SQLite.1.0.82.0, this causes a build failure, as it has a pair of DLLs that need to be copied to the build output directory...

x86\SQLite.Interop.dll

x64\SQLite.Interop.dll

When I run a build depending on System.Data.SQLite.1.0.82.0 under TeamCity, the content directory is not unpacked, and the build fails as follows:

function(){return A.apply(null,[this].concat($A(arguments)))}

[12:38:39][Publisher.Samples.SamplePublisher\Publisher.Samples.SamplePublisher.csproj] _CopyOutOfDateSourceItemsToOutputDirectoryAlways[12:38:39][_CopyOutOfDateSourceItemsToOutputDirectoryAlways] Copy[12:38:39][Copy] Creating directory "..\Build\bin\Debug\x64".[12:38:39][Copy] Copying file from "D:\TeamCityBuildAgent\work\68b9ab4bf9bc7734\Publisher.Samples.SamplePublisher\x64\SQLite.Interop.dll" to "..\Build\bin\Debug\x64\SQLite.Interop.dll".[12:38:39][Copy] c:\WINNT\Microsoft.NET\Framework\v4.0.30319\Microsoft.Common.targets(3159, 9): error MSB3021: Unable to copy file "D:\TeamCityBuildAgent\work\68b9ab4bf9bc7734\Publisher.Samples.SamplePublisher\x64\SQLite.Interop.dll" to "..\Build\bin\Debug\x64\SQLite.Interop.dll". Could not find a part of the path 'D:\TeamCityBuildAgent\work\68b9ab4bf9bc7734\Publisher.Samples.SamplePublisher\x64\SQLite.Interop.dll'.[12:38:39][Copy] Creating directory "..\Build\bin\Debug\x86".[12:38:39][Copy] Copying file from "D:\TeamCityBuildAgent\work\68b9ab4bf9bc7734\Publisher.Samples.SamplePublisher\x86\SQLite.Interop.dll" to "..\Build\bin\Debug\x86\SQLite.Interop.dll".[12:38:39][Copy] c:\WINNT\Microsoft.NET\Framework\v4.0.30319\Microsoft.Common.targets(3159, 9): error MSB3021: Unable to copy file "D:\TeamCityBuildAgent\work\68b9ab4bf9bc7734\Publisher.Samples.SamplePublisher\x86\SQLite.Interop.dll" to "..\Build\bin\Debug\x86\SQLite.Interop.dll". Could not find a part of the path 'D:\TeamCityBuildAgent\work\68b9ab4bf9bc7734\Publisher.Samples.SamplePublisher\x86\SQLite.Interop.dll'.[12:38:39][Publisher.Samples.SamplePublisher\Publisher.Samples.SamplePublisher.csproj] Project Publisher.Samples.SamplePublisher\Publisher.Samples.SamplePublisher.csproj failed.

is there a workaround for this (i.e. some way of making sure the content directory gets copied into the project during the NuGet Install build step)?

2 comments
Comment actions Permalink

I had the same problem, but it seems that upgrading to the latest NuGet (2.1.0) fixes the issue.

0
Comment actions Permalink

I have narrowed the problem further - it seems that the TeamCity NuGet Installer build step does not run any install scripts provided with a package.

When I install the System.Data.SQLite package in Visual Studio, after the message in the output I see:

Successfully installed 'System.Data.SQLite 1.0.84.0
Executing script file 'C:\Subversion\MyProject\packages\System.Data.SQLite.1.0.84.0\tools\install.ps1'.


In the TeamCity build output, I just get


Successfully installed 'System.Data.SQLite 1.0.84.0


... indicating that the post-install script was never run.

The reason is that scripts inside the tools directory of a NuGet package are only run when installing/uninstalling a package in Visual Studio (i.e. by using the Package Manager Console or GUI-based package manager).  TeamCity merely runs the command-line binary, whcih does not support additional install scripts.
0

Please sign in to leave a comment.