Click here to Skip to main content
15,884,298 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hi,

I am having difficult solving the following post-build event command error. I am using Eazfuscator.Net for obfuscation. So the first line is automatically added by it. Then, I needed a copy of the DLL file to a specific path. So I wrote the second command. When I build my project I have the following error:
The command "if /I "Debug" == "Release" Eazfuscator.NET.exe "C:\Users\XXX\Documents\Visual Studio 2012\Projects\Core\Core\bin\Debug\Core.dll" --msbuild-project-path "C:\Users\XXX\Documents\Visual Studio 2012\Projects\Core\Core\Core.csproj" --msbuild-project-configuration "Debug" --msbuild-project-platform "AnyCPU" --msbuild-solution-path "C:\Users\XXX\Documents\Visual Studio 2012\Projects\Core\Core.sln" -n --newline-flush -v 3.3<br />
c:\Windows\System32\xcopy.exe "C:\Users\XXX\Documents\Visual Studio 2012\Projects\Core\Core\bin\Debug\Core.dll" C:\Users\XXX\Inetpub\wwwroot\WebService\bin" exited with code 2.

My commands in the post-build:
Command 1:
if /I "$(ConfigurationName)" == "Release" Eazfuscator.NET.exe "$(TargetPath)" --msbuild-project-path "$(ProjectPath)" --msbuild-project-configuration "$(ConfigurationName)" --msbuild-project-platform "$(PlatformName)" --msbuild-solution-path "$(SolutionPath)" -n --newline-flush -v 3.3

Command 2:
c:\Windows\System32\xcopy.exe "$(TargetPath)" C:\Users\XXX\Inetpub\wwwroot\WebService\bin


I tried if my commands are correct by running them alone and it seems to be working fine. But when I keep them both I have an error. Can someone shed a light please? Thanks in advance.
Posted

1 solution

I think you need to escape your second command path, and you should have it skip prompting:

c:\Windows\System32\xcopy.exe "$(TargetPath)" "C:\Users\XXX\Inetpub\wwwroot\WebService\bin" /y
 
Share this answer
 
Comments
wonder-FOOL 7-Nov-13 11:02am    
Thank you.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900