ILMerge - the command exited with code 255

痴心易碎 提交于 2019-12-11 00:31:28

问题


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?


回答1:


Looking at the error message, I think

($TargetDir)foo.dll 

should be

$(TargetDir)foo.dll



回答2:


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.

  • http://answers.microsoft.com/en-us/windows/forum/windows_vista-system/the-extended-attributes-are-inconsistent/129b7935-2da2-47b2-8b4d-e8b581e12b54
  • http://www.vistaheads.com/forums/microsoft-public-windows-vista-general/93248-extended-attributes-inconsistent.html

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.




回答3:


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




回答4:


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).



来源:https://stackoverflow.com/questions/8859588/ilmerge-the-command-exited-with-code-255

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!