Jack
Jack

Reputation: 16724

ILMerge - the command exited with code 255

I'm trying to embed DLLs in single executable using ILMerge.

I added this command line in build events > post build event command line:

C:\Program Files\Microsoft\ILMerge\ILMerge.exe /out:$(TargetDir)Publish.exe 
($TargetDir)foo.dll

but when I try to run it, I get the following error:

The command "C:\Program Files\Microsoft\ILMerge\ILMerge.exe /out:C:\Publish.exe ($TargetDir)foo.dll" exited with code 255

how can I fix this?

Upvotes: 3

Views: 7769

Answers (4)

sgmoore
sgmoore

Reputation: 16067

Looking at the error message, I think

($TargetDir)foo.dll 

should be

$(TargetDir)foo.dll

Upvotes: 2

user270576
user270576

Reputation: 997

Exit code 255 means Studio is not able to find the file you are asking it to execute. Check your paths and remember to put quotes around paths with spaces

Upvotes: 1

Carlos Infoster
Carlos Infoster

Reputation: 21

I remember that I was getting this error when an external script was using Shell/Command Prompt to access an EXE.

One of the reasons could be working directory not being set correctly.

So, prior to calling the EXE/DLL, the working directory must be set correctly (where the executable lies).

Upvotes: 0

JaredPar
JaredPar

Reputation: 754715

I believe what's happening here is that ILMerge is encountering an error when accessing the file system and simply propagating that value to it's exit code. The error 255 in windows maps to ERROR_EA_LIST_INCONSISTENT.

I tried searching down the cause of that error and unfortunately most of the answers indicate that file system corruption is the cause.

Are you seeing this error when using other tools that touch the file in question? Many of the other reports saw the same error with explorer so I would try viewing, opening, etc ... with explorer and see if you get the same issue. If you do then the outcome isn't good as it suggests your hard drive is going bad.

Hopefully someone else will come along with a more cheerful answer.

Upvotes: 1

Related Questions