monodevelop-nuget-addin icon indicating copy to clipboard operation
monodevelop-nuget-addin copied to clipboard

Error while building a nuget restore project

Open jstawski opened this issue 10 years ago • 2 comments

I have started a project in Visual Studio 2013 Update 1 that contains 2 PCL projects among other types of projects. I enabled Nuget restore and all works well using VS, including on other machines. While opening the same solution in Xamarin Studio for Mac and building the project i get the error:

/path/.nuget/NuGet.targets: Error: Command 'mono --runtime=v4.0.30319 /path/.nuget/NuGet.exe install "/path/packages.config" -source "" -RequireConsent -solutionDir "/path/"' exited with code: 2. (Project.Core)

I even tried restoring the packages manually, but building the project still results in the same error.

I am using Xamarin Studio 4.2.4 with Nuget Package Management 0.9.

What could be the problem?

jstawski avatar May 06 '14 18:05 jstawski

Further investigation of the build output reveals an error that it can't find NuGet.exe, but the problem is that the path contains spaces. I removed the spaces from the path and the build worked as expected. Shouldn't the command include quotes on the path to NuGet.exe?

jstawski avatar May 06 '14 18:05 jstawski

I would try the latest NuGet.targets file available from codeplex and use this to replace the one in your .nuget directory. The latest NuGet.targets file fixes the problem with spaces in the path. This NuGet.targets has not yet been released by the NuGet team.

mrward avatar May 06 '14 18:05 mrward