Question

ctrlShiftB on Thu, 09 Mar 2017 09:13:36


Hello, everyone, sorry for my english.

I installed VS2017 yesterday, and i've tried to migrate solutions from VS2015.

Build command on one of them exited with code 1; the error does not occur in VS2015.

Lines of command are:

mkdir "$(SolutionDir)[path]" -> solved with: if not exist "$(SolutionDir)[path]" mkdir "$(SolutionDir)[path]"

nuget.exe pack "$(ProjectPath)" -IncludeReferencedProjects -Prop Configuration="$(Configuration)";Platform="$(Platform)" -ExcludeEmptyDirectories  -OutputDirectory "$(SolutionDir)[path]" -> unsolved

More in detail, the error is:

Severity Code Description Project File Line Suppression State
Error The command "mkdir "[path]"
nuget.exe pack "[path]" -IncludeReferencedProjects -Prop Configuration="Debug";Platform="AnyCPU" -ExcludeEmptyDirectories  -OutputDirectory "[path]"
" exited with code 1.



Sponsored



Replies

Leo--Liu on Fri, 10 Mar 2017 07:27:47


Hi ctrlShiftB,

Welcome to MSDN forum.

>>>Build command on one of them exited with code 1; the error does not occur in VS2015.

This is a known issue nuget.exe does not work with msbuild 12 as of 3.5.0 in Visual Studio 2017, which has been fixed at NuGet 4.0. So when you update you Visual Studio to 2017

So when you use the NuGet pack command line in the post event with the old version of NuGet, you will get that error.

To resolve this error, you need update your NuGet.exe to 4.0. You can download it here.

Note: You should provide the NuGet with its full path, and if there are spaces in full path, then one needs quotation marks around the command. E.g.

"D:\The folder with spaces\ABCDEF\nuget.exe" pack 
Hope this could help you.
____________________________________________________________________________
MSDN Community Support<br/> Please remember to click &quot;Mark as Answer&quot; the responses that resolved your issue, and to click &quot;Unmark as Answer&quot; if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact <a href="mailto:MSDNFSF@microsoft.com">MSDNFSF@microsoft.com</a>.

ctrlShiftB on Fri, 10 Mar 2017 08:42:18


I've tried, and now is working :)

Thanks a lot!

Leo--Liu on Fri, 10 Mar 2017 09:12:13


Hi ctrlShiftB,

Thanks for you vote me. If above answer that resolved your issue, you can click Mark as Answer to mark it which is benefit to other communities who has the same problem. Thanks, if not, you can let me know the latest message about this issue.


MSDN Community Support<br/> Please remember to click &quot;Mark as Answer&quot; the responses that resolved your issue, and to click &quot;Unmark as Answer&quot; if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact <a href="mailto:MSDNFSF@microsoft.com">MSDNFSF@microsoft.com</a>.