Visual Studio 2017 - Post build exited with code 9009
Visual Studio 2017 - Post build exited with code 9009
According to the error message, there should be some mistakes in your command line. So you should double check your command line in the post-build event. I would like give your some points to check your command:
-
If you have spaces in your command, you need to use double quotation marks on it.
nuget.exe pack "$(ProjectPath)" -IncludeReferencedProjects -OutputDirectory "$(SolutionDir)[path]"
Since
nuget.exe
is an external command for windows, we could not call it directly on windows, need to set the path ofnuget.exe
to the environment variable.
After add nuget.exe to the environment variable, I could execute below command line successfully, you can check it if works for you:
nuget.exe pack "$(ProjectPath)" -IncludeReferencedProjects -OutputDirectory "$(SolutionDir)Test"
Hope this helps.
Related videos on Youtube
Admin
Updated on November 29, 2020Comments
-
Admin over 3 years
Recently I updated my Visual Studio 2015 to 2017, then i've tried to migrate all my solutions from VS2015. But after migration, one of my project build failed with below error:
Severity Code Description Project File Line Suppression State Error The command nuget.exe pack [path] -IncludeReferencedProjects -OutputDirectory [path] " exited with code 9009.
In the post-build event, I have added below command:
nuget.exe pack $(ProjectPath) -IncludeReferencedProjects -OutputDirectory $(SolutionDir)[path]
This project was built successfully in Visual Studio 2015, but failed in the Visual Studio 2017.
Any suggestions are grateful.
-
Leo Liu over 6 years@votedown, can not understand the votedown, could please let me know the reason for it? So I can update my answer. Thanks.
-
Admin over 6 yearsDo not know the votedown. But the second point help me. Because I save my nuget.exe in the root directory C:\. After update my windows from windows 7 to windows 10 and update VS 2015 to 2017, I forgot to add the path into environment. Thanks for you again!
-
cwhsu about 5 yearsMy problem is that the project wants to run NuGet, but it seems VS 2017 do not have nuget.exe itself. Hence, I download it, and put it under windows folder. stackoverflow.com/questions/15097538/…