Reputation: 2482
I have previously created and built a simple .net core nuget package and pushed it to our internal nuget (hosted inside our VSO). Now I wanted to reference it from another core project. This worked fine locally.
I then go onto defining my build. Here are the details:
When I run the build I get this error on the Nuget Installer bit:
[command]C:\a\_tasks\....\NuGet\3.5.0\NuGet.exe restore -NonInteractive C:\a\1\s\...sln -ConfigFile C:\a\1\s\...\nuget.config
Failed to load msbuild Toolset
Could not load file or assembly 'Microsoft.Build, Version=14.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified.
Things I've Tried:
Thanks for any help!
Upvotes: 2
Views: 1324
Reputation: 38096
You need to use NuGet 4.0 instead of 3.5 since your project is based on VS2017.
Now NuGet 4.0 is available for NuGet Installer task, so you can select the version directly and needn’t checkin the version to your source code.
For some VSTS accounts don't show nuget 4.0, I creates a new issue here, you can follow up.
Another way to use NuGet 4.0 for TFVC project:
nuget4.0.exe
.$(build.sourcesDirectory)/nuget4.0.exe
.Upvotes: 3
Reputation: 165
I had this issue too and found this thread.
After reviewing Marina's comments, I was able to get it working. All I did was alter the path based on the comments.
$(Build.SourcesDirectory)\Builds\Tools\nuget.exe
Upvotes: 1