NuGet.exe install error 9009 - Downloaded Git repo

2019-09-04 05:52发布

问题:

I'm not the most experienced programmer so please excuse any information that is irrelevant here. Better for me to put as much detail down as I can.

I'm working with a team solution in Visual Studio 2013 on windows, and just recently we had some issues to do with NuGet packages. Another member of my team solved the issue by reinstalling a package "Microsoft.AspNet.WebApi". I have now pulled the latest version and it won't build on my machine, although it does on my team members machine.

It shows the error:

"Error  1   The command "mono --runtime=v4.0.30319
(projectdirectory)\.nuget\NuGet.exe install "packages.config" -source ""   -                                                        
RequireConsent -solutionDir "(projectdirectory)"" exited with code 9009."

I have found semi-relevant posts about this and have checked the nuget.targets directory for the use of the solutionDir variable and in fact that whole file is up to date as per https://nuget.codeplex.com/SourceControl/latest#src/Build/NuGet.targets

I've also updated all NuGet packages and the packages.config file within the solution from both the package manager console and the manage NuGet packages window.

Does anybody understand why this 9009 error would be presenting/understand what is necessary to fix it?

Any help very much appreciated as more understanding of the area might help me to debug it also.

Thanks, JK

回答1:

Thanks for the replies, I seem to have solved the problem.

I had seen the post Jaco but it hadn't solved my issue. I found another error message on startup in the Package Manager Console which mentioned init.ps1 in the entity framework folder could not be loaded because execution of scripts was disabled. this turned out to be an issue with PowerShell which was fixed by going to the Powershell command prompt and executing the:

Set-executionPolicy Unrestricted -Scope CurrentUser

I had to use CurrentUser because of weird permissions on my machine which wouldn't let me do it universally.

I originally had build issues with Nuget packages not being present after this but they were errors I'd seen before and just involved reloading certain packages into the projects references.

Thanks for the replies, I only noticed the more meaningful error just now.



回答2:

There is an older post on this that might help with your problem:

nuget install exit code 9009

In short the error code 9009 is raised as Visual Studio can't find Nuget.exe.

Please let me know if this post doesn't resolve your problem.