Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

nuget.exe restore fails with Visual Studio 2015 toolset #4713

Closed
jozefizso opened this issue Feb 28, 2017 · 1 comment
Closed

nuget.exe restore fails with Visual Studio 2015 toolset #4713

jozefizso opened this issue Feb 28, 2017 · 1 comment
Milestone

Comments

@jozefizso
Copy link
Contributor

jozefizso commented Feb 28, 2017

Details about Problem

NuGet product used: NuGet.exe

NuGet version: 4.0.0.2275

VS version: Visual Studio 2015 Professional, Update 3

OS version (i.e. win10 v1607 (14393.321)): win10-pro v1607 (14393.693)

Detailed repro steps so we can see the same problem

  1. Clone NuGetGallery from https://github.com/NuGet/NuGetGallery
  2. Checkout tag v2017.02.24
  3. Run .\build.cmd
  4. Build will run nuget.exe restore C:\dev\github\NuGetGallery\NuGetGallery.sln -MSBuildVersion 14 command
  5. This will fail with error Cannot find the specified version of msbuild: '14'

Other suggested things

NuGet Docs says that -MSBuildVersion supports values 4, 12, 14 and 15. I have Visual Studio 2015 installed so NuGet should work with version 14.

Workarround: using version '14.0' will use the correct MSBuild toolset, eg. nuget.exe restore C:\dev\github\NuGetGallery\NuGetGallery.sln -MSBuildVersion 14.0

Verbose Logs

C:\dev\github\NuGetGallery\.nuget\nuget.exe restore C:\dev\github\NuGetGallery\NuGetGallery.sln -MSBuildVersion 14 -Verbosity detailed
NuGet Version: 4.0.0.2275
System.AggregateException: One or more errors occurred. ---> NuGet.CommandLine.CommandLineException: Cannot find the specified version of msbuild: '14'
   at NuGet.CommandLine.MsBuildUtility.GetToolsetFromUserVersion(String userVersion, IEnumerable`1 installedToolsets)
   at NuGet.CommandLine.MsBuildUtility.GetMsBuildDirectoryInternal(String userVersion, IConsole console, IEnumerable`1 installedToolsets, Func`1 getMsBuildPathInPathVar)
   at NuGet.CommandLine.MsBuildUtility.GetMsBuildDirectory(String userVersion, IConsole console)
   at System.Lazy`1.CreateValue()
   at System.Lazy`1.LazyInitValue()
   at NuGet.CommandLine.RestoreCommand.ProcessSolutionFile(String solutionFileFullPath, PackageRestoreInputs restoreInputs)
   at NuGet.CommandLine.RestoreCommand.<DetermineRestoreInputsAsync>d__37.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at NuGet.CommandLine.RestoreCommand.<ExecuteCommandAsync>d__30.MoveNext()
   --- End of inner exception stack trace ---
   at System.Threading.Tasks.Task.ThrowIfExceptional(Boolean includeTaskCanceledExceptions)
   at System.Threading.Tasks.Task.Wait(Int32 millisecondsTimeout, CancellationToken cancellationToken)
   at NuGet.CommandLine.Command.Execute()
   at NuGet.CommandLine.Program.MainCore(String workingDirectory, String[] args)
---> (Inner Exception #0) NuGet.CommandLine.CommandLineException: Cannot find the specified version of msbuild: '14'
   at NuGet.CommandLine.MsBuildUtility.GetToolsetFromUserVersion(String userVersion, IEnumerable`1 installedToolsets)
   at NuGet.CommandLine.MsBuildUtility.GetMsBuildDirectoryInternal(String userVersion, IConsole console, IEnumerable`1 installedToolsets, Func`1 getMsBuildPathInPathVar)
   at NuGet.CommandLine.MsBuildUtility.GetMsBuildDirectory(String userVersion, IConsole console)
   at System.Lazy`1.CreateValue()
   at System.Lazy`1.LazyInitValue()
   at NuGet.CommandLine.RestoreCommand.ProcessSolutionFile(String solutionFileFullPath, PackageRestoreInputs restoreInputs)
   at NuGet.CommandLine.RestoreCommand.<DetermineRestoreInputsAsync>d__37.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at NuGet.CommandLine.RestoreCommand.<ExecuteCommandAsync>d__30.MoveNext()<---
@emgarten emgarten added this to the 4.5 milestone Oct 18, 2017
@emgarten
Copy link
Member

Thanks for reporting this issue. We have not been able to reproduce this issue. If you are still able to reproduce this with the latest NuGet version, please provide additional steps.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants