Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I resolve the error: "The command [...] exited with code 1"?

I've read around many questions but I've not been able to find the right answer for me.

As I try to compile a project in VS2012 I have this result:

The command "....\tools\bin\nuget pack Packages\Lib.Html.nuspec - OutputDirectory ....\bin\Zip\Packages -NoPackageAnalysis" exited with code 1.

I looked for the line of code in my .csproj file, where the error should be, and there is:

<Exec Command="$(ProjectDir)..\..\tools\bin\nuget pack $(ProjectDir)Packages\Lib.Html.nuspec -OutputDirectory $(OutputPath)Packages -NoPackageAnalysis" />   

What am I doing wrong?

[EDIT] Launching the Debug of that project and ignoring "building errors", I have a new alert:

"Visual Studio cannot start debugging because the debug target '[project.exe path]' is missing. Please build the project and retry, or set OutputPath and AssemblyName properties appropriately to point at the correct location for the target assembly."

like image 311
xnr_z Avatar asked Mar 03 '14 16:03

xnr_z


People also ask

Has Code 1 been exited?

What is Exit Code 1. Exit Code 1 indicates that a container shut down, either because of an application failure or because the image pointed to an invalid file. In a Unix/Linux operating system, when an application terminates with Exit Code 1, the operating system ends the process using Signal 7, known as SIGHUP.


1 Answers

The first step is figuring out what the error actually is. In order to do this expand your MsBuild output to be diagnostic. This will reveal the actual command executed and hopefully the full error message as well

  • Tools -> Options
  • Projects and Solutions -> Build and Run
  • Change "MsBuild project build output verbosity" to "Diagnostic".
like image 155
JaredPar Avatar answered Sep 23 '22 19:09

JaredPar