I am writing an ASP.NET web application using Visual Studio 2008. The project basically does not change from the default empty project that Visual Studio provides, with the exception of:
- In properties-> Build-> Output, the "XML documentation file" is marked and set to "bin \ MyProject.XML"
- In properties-> assembly events "Command line of the event after assembly:" is set to
copy /y "$(TargetDir)$(TargetName).XML" "C:\TEMP\"
When I create a project for the first time or rebuild, the build process completes successfully. However, if I try to build any time after this, the build process will end with this message:
------ Build started: Project: MyProject, Configuration: Debug Any CPU ------ MyProject -> C:\Projects\MyProject\MyProject\bin\MyProject.dll copy /y "C:\Projects\MyProject\MyProject\bin\MyProject.XML" "C:\TEMP\" The system cannot find the file specified. c:\WINDOWS\Microsoft.NET\Framework\v3.5\Microsoft.Common.targets(3397,13): error MSB3073: The command "copy /y "C:\Projects\MyProject\MyProject\bin\MyProject.XML" "C:\TEMP\"" exited with code 1. Done building project "MyProject.csproj" -- FAILED. ========== Build: 0 succeeded or up-to-date, 1 failed, 0 skipped ==========
I am sure that the syntax is correct because I can execute the post-build command in the command window:
C:\>copy /y "C:\Projects\MyProject\MyProject\bin\MyProject.XML" "C:\TEMP\" 1 file(s) copied.
The team works when I do it manually, so why does it fail when it is part of the build process?
source share