I am getting these errors when running a MSBuild build step that builds a web project in TeamCity and I have setup my Nuget targets file PackageSource to point to a local Nuget server e.g. PackageSource Include="http://mylocaldevurl/nuget/Packages" .
The build runs and produces errors of the form e.g. Exec] F:\TeamCity\buildAgent\work\blahblah.nuget\NuGet.targets(87, 9): Unable to read package from path 'Lucene.Net.3.0.3.nupkg'.
Whats is strange other packages are downloaded fine to the TeamCity working folder -the package folder.
The local Nuget Server contains copies of my VS solution packages(the ones in the default packages folder) with only the .nupkg files.
My question is there something that I need to do when copying the .nupkg files to that server.I might be missing something.
I have already doubled checked that the packages exist in the local Server
config file. You can restore packages manually with nuget restore , dotnet restore , msbuild -t:restore , or through Visual Studio. The dotnet build and dotnet run commands automatically restore packages, and you can configure Visual Studio to restore packages automatically when it builds a project.
Menu Tools → Options → Package Manager Click OK. Drop your NuGet package files in that folder. Go to your Project in Solution Explorer, right click and select "Manage NuGet Packages". Select your new package source.
I had this same problem using TFS. What I did that fixed it was clear the nuget cache in the user profile that was running the build (%LocalAppData%\NuGet\Cache). I just emptied the directory and ran the build again, then it worked.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With