Che cosa significa “terminato con il codice 9009” media durante questa build?

StackOverflow https://stackoverflow.com/questions/1351830

  •  20-09-2019
  •  | 
  •  

Domanda

Che cosa significa questo messaggio di errore significa? Che cosa potevo fare per correggere questo problema?

  

AssemblyInfo.cs terminato con il codice 9009


Il problema è probabilmente accadendo come parte di un post-generazione passo in una soluzione .NET in Visual Studio.

Nessuna soluzione corretta

Altri suggerimenti

Hai provato a dare il percorso completo del comando che è in esecuzione nel comando pre o post-generazione evento?

stavo ottenendo l'errore 9009 a causa di un comando evento xcopy post-generazione in Visual Studio 2008.

  

Il "xcopy.exe /Y C:\projectpath\project.config C:\compilepath\" comando terminato con il codice 9009.

Ma nel mio caso è stato anche intermittente. Cioè, il messaggio di errore persiste fino a quando un riavvio del computer, e scompare dopo un riavvio del computer. E 'tornato dopo qualche problema in remoto relativi sono ancora da scoprire.

Tuttavia, nel mio caso, fornire il comando con il percorso completo risolto il problema:

c:\windows\system32\xcopy.exe /Y C:\projectpath\project.config C:\compilepath\ 

Invece di limitarsi a:

xcopy.exe /Y C:\projectpath\project.config C:\compilepath\

Se non ho il percorso completo, che corre per un po 'dopo un riavvio, e poi si ferma.

Inoltre, come indicato sui commenti a questo post, se ci sono spazi in percorso completo, quindi si ha la necessità le virgolette attorno al comando . Per esempio.

"C:\The folder with spaces\ABCDEF\xcopy.exe" /Y C:\projectpath\project.config C:\compilepath\

Si noti che questo esempio per quanto riguarda gli spazi non è testato.

Codice errore 9009 significa file di errore non trovato. Tutte le motivazioni sottostanti pubblicati nelle risposte qui sono buona ispirazione di capire perché, ma l'errore in sé significa semplicemente una cattiva strada.

Succede quando si sta perdendo alcune impostazioni di ambiente per l'utilizzo di strumenti di Visual Studio x86 di Microsoft.
Pertanto, prova ad aggiungere come primo comando nelle fasi di post-generazione:

Per Visual Studio 2010 l'uso:

call "$(DevEnvDir)..\Tools\vsvars32.bat"

Come @FlorianKoch accennato nei commenti, per VS 2017 uso:

call "$(DevEnvDir)..\Tools\VsDevCmd.bat"

Si deve essere collocato prima di qualsiasi altro comando.
Sarà set ambiente per l'utilizzo di strumenti di Visual Studio x86 di Microsoft.

Molto probabilmente si dispone di spazio nel tuo percorso risultante.

È possibile aggirare il citando i percorsi, permettendo così gli spazi. Ad esempio:

xcopy "$(SolutionDir)\Folder Name\File To Copy.ext" "$(TargetDir)" /R /Y /I

Ha avuto la stessa variabile dopo aver cambiato variabile PATH dalle variabili ambientali in Win 7. Cambiare di nuovo a difetto aiutato.

Ho avuto l'errore 9009, quando il mio script di build post evento stava cercando di eseguire un file batch che non esisteva nel percorso specificato.

ho causato questo errore accada quando ho redatto la mia variabile di ambiente Path. Dopo la modifica, ho aggiunto accidentalmente Path= all'inizio della stringa di percorso. Con una variabile di percorso come malformati, ero in grado di eseguire XCopy dalla riga di comando (nessun comando o file non trovato), e Visual Studio sono rifiutato di eseguire post-generazione passo, errore che cita con il codice 9009.

XCopy risiede comunemente in C: \ Windows \ System32. Una volta che la variabile di ambiente Path permesso XCopy per ottenere risolto al prompt di DOS, Visual Studio costruito la mia soluzione bene.

Se lo script in realtà fa quello che deve fare ed è solo Visual Studio intercettazioni sull'errore si può solo aggiungere:

exit 0

alla fine di voi script.

Controlla l'ortografia. Stavo cercando di chiamare un eseguibile, ma aveva il nome scritto male e mi ha dato il messaggio exited with code 9009.

Nel mio caso ho dovuto "CD" (Change Directory) nella directory appropriata prima, prima di chiamare il comando, dal momento che l'eseguibile stavo chiamando è stato nella mia directory del progetto.

Esempio:

cd "$(SolutionDir)"
call "$(SolutionDir)build.bat"

Il mio errore esatto è stato

The command "iscc /DConfigurationName=Debug "C:\Projects\Blahblahblah\setup.iss"" exited with code 9009.

9009 significa file non trovato, ma in realtà non riusciva a trovare la parte "ISCC" del comando.

ho riparato aggiungendo ";C:\Program Files\Inno Setup 5 (x86)\" all'ambiente sistema "path" variabile

Un'altra variante:

oggi vi invito interprete Python da cron in Win32 e prendere ExitCode (% ERRORLEVEL%) 9009, a causa account di sistema utilizzato da cron non hanno percorso alla directory Python.

Il problema nel mio caso si è verificato quando ho provato ad utilizzare un comando sulla riga di comando per l'evento post-generazione nella mia libreria di classi di prova. Quando si utilizzano le virgolette in questo modo:

"$(SolutionDir)\packages\NUnit.Runners.2.6.2\tools\nunit" "$(TargetPath)" 

o se si sta utilizzando la console:

"$(SolutionDir)\packages\NUnit.Runners.2.6.2\tools\nunit-console" "$(TargetPath)"

Questo risolto il problema per me.

Inoltre, assicurarsi che non vi siano interruzioni di riga nel post evento accumulo finestra di modifica sul progetto. A volte la copia del comando xcopy dal web quando è più righe e incollandolo in VS causerà un problema.

Ho aggiunto "> myFile.txt" al fine della riga nella fase di pre-compilazione e quindi ispezionato il file per l'errore effettivo.

La risposta di TFA è stata downvoted, ma in realtà può causare questo problema. Grazie a hanzolo, ho guardato nella finestra di output e trovato il seguente:

3>'gulp' is not recognized as an internal or external command,
3>operable program or batch file.
3>D:\dev\<filepath>\Web.csproj(4,5): error MSB3073: The command "gulp clean" exited with code 9009.

Dopo l'esecuzione npm install -g gulp, ho smesso di ottenere questo errore. Se stai ricevendo questo errore in Visual Studio, controllare la finestra di output e vedere se il problema è una variabile d'ambiente impostata.

Per quanto mi riguarda, lo spazio su disco è stata bassa, e file che non potevano essere scritti ci si aspettava di essere presenti in seguito. Altre risposte menzionati file mancanti (o misnamed / file impropriamente riferimento-by-name) -., Ma la causa principale era la mancanza di spazio su disco

Yet another variant of file not found, because of spaces in the path. In my case in the msbuild script. I needed to use HTML style &quot; strings within the exec command.

<!-- Needs quotes example with my Buildscript.msbuild file --> 
<Exec Command="&quot;$(MSBuildThisFileDirectory)\wix\wixscript.bat&quot; $(VersionNumber) $(VersionNumberShort)" 
    ContinueOnError="false" 
    IgnoreExitCode="false" 
    WorkingDirectory="$(MSBuildProjectDirectory)\wix" />

Same as the other answers, in my case it was because of the missing file. To know what is the missing file, you can go to the output window and it will show you straight away what went missing.

To open the output window in Visual Studio:

  1. Ctrl+Alt+O
  2. View > Output

enter image description here

I fixed this by simply restarting Visual Studio - I had just run dotnet tool install xxx in a console window and VS hadn't yet picked up the new environment variables and/or path settings that were changed, so a quick restart fixed the issue.

This is pretty basic, I had this problem, and embarrassing simple fail.

Application use Command line arguments, I removed them and then added them back. Suddenly the project failed to build.

Visual Studio -> Project Properties -> verify that you use 'Debug' tab (not 'Build Events' tab) -> Command Line Arguments

I used the and Post/Pre-build text area, which was wrong this case.

For me it happened after upgrade nuget packages from one PostSharp version to next one in a big solution (~80 project). I've got compiler errors for projects that have commands in PreBuild events.

'cmd' is not recognized as an internal or external command, operable program or batch file. C:\Program Files (x86)\MSBuild\14.0\bin\Microsoft.Common.CurrentVersion.targets(1249,5): error MSB3073: The command "cmd /c C:\GitRepos\main\ServiceInterfaces\DEV.Config\PreBuild.cmd ServiceInterfaces" exited with code 9009.

PATH variable was corrupted becoming too long with multiple repeated paths related to PostSharp.Patterns.Diagnostics. When I closed Visual Studio and opened it again, the problem was fixed.

My solution was just simple as: have you tried turning it off and on again? So I restarted the computer and the issue was gone.

I also ran into this 9009 problem when facing an overwrite situation.

Basically, if the file already exists and you have not specified the /y switch (which automatically overwrites) this error can happen when run from a build.

Actually I noticed that for some reason the %windir% environment variable sometimes get erased. What worked for me was re-set the windir environment variable to c:\windows, restart VS, and that's it. That way you prevent having to modify the solution files.

At least in Visual Studio Ultimate 2013, Version 12.0.30723.00 Update 3, it's not possible to separate an if/else statement with a line break:

works:

if '$(BuildingInsideVisualStudio)' == 'true' (echo local) else (echo server)

doesn't work:

if '$(BuildingInsideVisualStudio)' == 'true' (echo local) 
else (echo server)

Yet another reason: If your pre-build event references another projects bin path and you see this error when running msbuild, but not Visual Studio, then you have to manually arrange the projects in the *.sln file (with a text editor) so that the project you are targeting in the event is built before the event's project. In other words, msbuild uses the order that projects are listed in the *.sln file whereas VS uses knowledge of project dependencies. I had this happen when a tool that creates a database to be included in a wixproj was listed after the wixproj.

I think in my case there were russian symbols in path (all projects were in user folder). When I put solution in another folder (directly on disk), everything became ok.

My solution was to create a copy of the file and add a step to the build task to copy my file over the original.

You need to make sure you have installed grunt globally

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top