Reputation: 16724
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
Reputation: 16067
Looking at the error message, I think
($TargetDir)foo.dll
should be
$(TargetDir)foo.dll
Upvotes: 2
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
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
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