問題描述
Dotfuscator 構建後事件退出,代碼 1 (Dotfuscator Post‑Build Event Exited With Code 1)
我試圖在 TFS 的構建過程中自動對我的項目進行 dotfuscate。
我在項目屬性下創建了“Post‑Build Event”如下:
"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)"
當這個事件開始我收到以下錯誤:
"C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Microsoft.Common.targets (3717):並在此主題上進行谷歌搜索,但無法找出錯誤的解釋。當我在本地運行構建時,命令工作得很好。任何幫助將不勝感激
編輯:我已經多次嘗試讓dotfuscator通過命令行工作。我已經確保 dotfuscator 命令在本地自行工作,但是當我運行構建定義時,dotfuscator 命令行以代碼 1 退出,如下所示,我不知道如何修復它:
C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Microsoft.Common.targets (3717):命令“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: /blockquote>
我仍然無法讓 dotfuscator 在我的自動化構建中工作,有沒有人舉個例子說明他們是如何做到的。我真的很感激這個問題的答案。
/blockquote>我仍然無法讓 dotfuscator 在我的自動化構建中工作,有沒有人舉個例子說明他們是如何做到的。我真的很感激這個問題的答案。
參考解法
方法 1:
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(?)]
(by Aaron Davis、Liam)
參考文件