Question

I get an error, while compiling my C#-code with Visual Studio 2010 on Windows 7.

I have these Build Events (Post-build Event Command Line):

if not "$(ConfigurationName)"=="Release" goto :finish 
"$(TargetDir)mt.exe" -manifest "$(ProjectDir)$(TargetName).exe.manifest" –outputresource:"$(TargetDir)$(TargetFileName)";#1
"$(ProjectDir)ILMerge.exe" /out:"$(TargetDir)Merged\Software.exe" "$(TargetPath)" "$(ProjectDir)bin\x86\Dlls\mwc.dll" "$(ProjectDir)bin\x86\Dlls\Interop.Access.dll" "$(ProjectDir)bin\x86\Dlls\Interop.DAO.dll"
:finish

If I remove: $(ProjectDir)bin\x86\Dlls\Interop.Access.dll everything is fine. With this code, I get this error if I rebuild my code:

exited with code 1.

I think it didn't find the dll-file, but it is there. I have checked it for many times...

I have no idea how to fix that.

@edit: sorry, i've made a mistake, this is the right code now... it does'nt work anyway

Was it helpful?

Solution

You're missing a closing quote at the end of the $(ProjectDir)bin\x86\Dlls\Interop.Access.dll

"$(ProjectDir)ILMerge.exe" /out:"$(TargetDir)Merged\Software.exe" "$(TargetPath)" "$(ProjectDir)bin\x86\Dlls\mwc.dll" "$(ProjectDir)bin\x86\Dlls\Interop.Access.dll "$(ProjectDir)bin\x86\Dlls\Interop.DAO.dll"

Should be...

"$(ProjectDir)ILMerge.exe" /out:"$(TargetDir)Merged\Software.exe" "$(TargetPath)" "$(ProjectDir)bin\x86\Dlls\mwc.dll" "$(ProjectDir)bin\x86\Dlls\Interop.Access.dll" "$(ProjectDir)bin\x86\Dlls\Interop.DAO.dll"

OTHER TIPS

There is no easy way to debug post-build scripts. One of possible ways, I personally use, is execute suspicios line(s) separately in console and hopefully get more detailed explanation of what is going on there.

So try, for example, exeute ILMerge with the command line arguments you use in post build event, and see what happens.

Good luck.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top