简体   繁体   中英

Dotfuscator Post-Build Event Exited With Code 1

I am trying to automatically dotfuscate my projects during the build process in TFS.

I have created a "Post-Build Event" under the project properties as follows:

"C:\\Program Files (x86)\\PreEmptive Solutions\\Dotfuscator Professional Edition 4.9\\dotfuscator.exe" /in:"$(TargetPath)" /out:"$(TargetDir)Obfuscated\\" /honor:on /strip:on /prune:off /rename:off /suppress:on /mapout:"$(TargetFileName).xml" /debug:pdb xcopy /S /R /Y "$(TargetDir)Obfuscated\\$(TargetFileName)" "$(TargetDir)"

When this event kicks off I get the following error:

"C:\\Windows\\Microsoft.NET\\Framework64\\v4.0.30319\\Microsoft.Common.targets (3717): The command ""C:\\Program Files (x86)\\PreEmptive Solutions\\Dotfuscator Professional Edition 4.9\\dotfuscator.exe" /in:"C:\\Builds\\5\\BIMS\\Sandbox Branch Private Test Manual Build\\Binaries\\ProcessBookmarks.exe" /out:"C:\\Builds\\5\\BIMS\\Sandbox Branch Private Test Manual Build\\Binaries\\Obfuscated\\" /honor:on /strip:on /prune:off /rename:off /suppress:on /mapout:"ProcessBookmarks.exe.xml" /debug:pdb xcopy /S /R /Y "C:\\Builds\\5\\BIMS\\Sandbox Branch Private Test Manual Build\\Binaries\\Obfuscated\\ProcessBookmarks.exe" "C:\\Builds\\5\\BIMS\\Sandbox Branch Private Test Manual Build\\Binaries\\"" exited with code 4."

I have done hours of research, experimentation, and googling on this subject and have not been able to figure out explaination for the error. When I run the build locally the command works just fine. Any help would be greatly appreciated

Edit: I have made several more attempts at getting dotfuscator to work via command line. I have ensured that the dotfuscator command works by itself locally, but when I run the build definition the dotfuscator command line exits with code 1 as follows, and I have no idea how to fix it:

C:\\Windows\\Microsoft.NET\\Framework64\\v4.0.30319\\Microsoft.Common.targets (3717): The command ""C:\\Program Files (x86)\\PreEmptive Solutions\\Dotfuscator Professional Edition 4.9\\dotfuscator.exe" /in:"C:\\Builds\\5\\BIMS\\Sandbox Branch Private Test Manual Build\\Binaries\\ProcessBookmarks.exe" /out:"C:\\Builds\\5\\BIMS\\Sandbox Branch Private Test Manual Build\\Binaries\\Obfuscated" /honor:on /strip:on /prune:off /enhancedOI:on /suppress:on /mapout:"C:\\Builds\\5\\BIMS\\Sandbox Branch Private Test Manual Build\\Binaries\\ProcessBookmarks.exe.xml" /debug:pdb" exited with code 1.

I am still having trouble with getting dotfuscator to work in my automated builds, does anyone have an example of how they are doing it. I would really appreciate an answer to this question.

I would suggest using copy rather than xcopy to copy your obfuscated dlls to your output folder.

The reason I suggest this is because I have spent the day trying to do the same as you, except I have Dotfuscator projects (*.dotfuproj) in my solution (rather than calling Dotfuscator via the commandline in the post build step) and I was trying to copy the Dotfuscator output during the Dotfuscator projects post build step.

When I used xcopy it failed to copy the file with no warning, error or message of any sort. It just continued like nothing happened - no positive or negative output. Nothing.

Executing the xcopy command via the command line worked fine - nothing made sense as to why xcopy did not work and why I got no message indicating why. [If anyone know why this is I would love to know]

With copy you need to specify the destination file rather than just the directory as you have above in your xcopy command.

[I would have added this as a comment to your question but I don't appear to have the ability/rep(?)]

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM