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?
Looking at the error message, I think
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.
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
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).