Error Msb3073 The Command Copy /y
Contents |
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more error msb3073 the command xcopy about Stack Overflow the company Business Learn more about hiring developers or posting error msb3073 the command exited with code 9009 ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack error msb3073 the command setlocal Overflow is a community of 4.7 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up Copy Failed during post-build process up vote 4 down vote favorite
Error Msb3073 The Command Exited With Code 3
I am writing an ASP.NET web application using Visual Studio 2008. The project is mostly unchanged from the default empty project that Visual Studio provides, except for: In Properties->Build->Output, "XML documentation file" is checked and set to "bin\MyProject.XML" In Properties->Build Events, "Post-build event command line:" is set to copy /y "$(TargetDir)$(TargetName).XML" "C:\TEMP\" When I build the project for the first time, or rebuild, the build process completes successfully. If error msb3073 the command exited with code 1 I try to build any time after that, however, the build process fails 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'm certain that the syntax is correct, because I can perform the post-build command in a command window: C:\>copy /y "C:\Projects\MyProject\MyProject\bin\MyProject.XML" "C:\TEMP\" 1 file(s) copied. The command works when I do it manually, so why does it fail when it is part of the build process? visual-studio-2008 post-build-event share|improve this question asked Dec 6 '11 at 13:57 Kevin 43.2k74079 add a comment| 1 Answer 1 active oldest votes up vote 6 down vote accepted +50 There is a flaw in the underlying msbuild tasks that are used by Visual Studio when the XML documentation file is generated in the same directory as the one specified as the output path, for intermediary builds. To fix it, you need to specify a different directory, for example, like this: and change your post-build copy command accordingly, like t
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta error msb3073 exited with code 4 Discuss the workings and policies of this site About Us Learn
Error Msb3073 Exited With Code 2
more about Stack Overflow the company Business Learn more about hiring developers or posting ads with us
Error Msb3073 Exited With Code 255
Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 4.7 million programmers, just like http://stackoverflow.com/questions/8401055/copy-failed-during-post-build-process you, helping each other. Join them; it only takes a minute: Sign up How do I fix MSB3073 error in my post-build event? up vote 11 down vote favorite 4 I'm working on a project that requires that DLLs generated by building my solution to be copied from the bin folder to another folder, both of which http://stackoverflow.com/questions/17075279/how-do-i-fix-msb3073-error-in-my-post-build-event are on my machine, in my C drive. I've written a batch file that uses xcopy to accomplish this, which you can see here: xcopy /s /y /q "C:\Users\scogan\Documents\Visual Studio 2012\Projects\Organizr\Server\bin\Debug\Organizr.Services.dll" "C:\inetpub\wwwroot\AppServer\bin\" xcopy /s /y /q "C:\Users\scogan\Documents\Visual Studio 2012\Projects\Organizr\Server\bin\Debug\Organizr.Services.pdb" "C:\inetpub\wwwroot\AppServer\bin\" Now, I've tried numerous iterations of this file, which is located at: C:\Users\scogan\Desktop\CopyFiles.bat so my post-build event command line looks like this: call C:\Users\scogan\Desktop\CopyFiles.bat I've run this batch file on its own with two text files in folders on my desktop, and it works fine. I've also run it as it is with the files I need to copy on its own, and that works fine, too. However, when I try to run this as a post-build event, I get this output: 1> Organizr -> C:\Users\scogan\Documents\Visual Studio 2012\Projects\Organizr\Client\bin\Debug\Organizr.exe 1> File not found - Organizr.Services.dll 1> 0 File(s) copied 1> 0 File(s) copied 1> File not found - Organizr.Services.pdb 1>c:\Windows\Microsoft.NET\Framework\v4.0.30319\Microsoft.Common.targets(4291,5): error MSB3073: The command "call C:\Users\scogan\Desktop\CopyFiles.bat" exited with code 4. I've done some research, and found that error c
/Yresults in...Quote...\Amethyst.targets(62,3): error MSB3073: The command "copy C:\Projects\GCflash\Assets\gc_game_data.xml C:\Projects\GCfacebook\gc\ /Y" exited with code 1.Attempting to add an extra \ after the http://sapphiresteel.com/forum/index.php?topic=595.0;wap2 various $(SolutionDir) parameters in the command line, results in the https://social.msdn.microsoft.com/Forums/vstudio/en-US/553a5f79-3964-4f95-b48e-82abacaea9f0/msbuild-error-msb3073?forum=tfsbuild same exact command executed without the needed slash and the same error.Please advise.Thanks,Jason Dermot: Try quotes around file names and $(SolutionDir) like this:Code:copy "$(SolutionDir)flash\Assets\gc_game_data.xml" "$(SolutionDir)facebook\gc" /YIf the directory has spaces in it, then Windows will have a problem in interpreting the error msb3073 command.The Pre/Post build commands are just executed by the Windows shell command processor.Dermot Jason King: Hi Dermot,I don't have spaces in my SolutionDir, but I tried the quotes anyways and that did not help. All my post-build events were working with Amethyst v1.2.Please continue to advise.Thanks,Jason Dermot: Hi Jason,We made error msb3073 the a change in 1.3 so that the macros remain unsubstituted in the project file (like they do in C#) rather than being substituted - but that's the only change here.In front of copy try putting echo:Code:echo copy "$(SolutionDir)flash\Assets\gc_game_data.xml" "$(SolutionDir)facebook\gc" /YThen you can see what the copy will be trying to do. Then from the output window paste the copy command into a DOS box and see what it does.So in my output window I see this:Code:Target "AfterBuild" in project "AmethystLibrary2.amproj" Task "Exec" echo copy "C:\Data\TestProjects\AmethystLibrary2flash\Assets\gc_game_data.xml" "C:\Data\TestProjects\AmethystLibrary2facebook\gc" /Y copy "C:\Data\TestProjects\AmethystLibrary2flash\Assets\gc_game_data.xml" "C:\Data\TestProjects\AmethystLibrary2facebook\gc" /YI can then copy the "copy ..." (so to speak) and see what it does when I paste it into a command prompt.See if that adds any light on the matter.Dermot Dermot: Jason,I've just checked the 1.2 code and SolutionDir isn't there. At least, Amethyst doesn't create it. However, in 1.3, it is explicitly created.So that's a difference - in
> Team Foundation Server - Build and release management Question 0 Sign in to vote I'm building a project in msbuild and it fails to copy a config file even though the path seems to becorrect. I'm not using any custom targets or tasks.I tried troubleshooting the copy and exec tasks working with relative paths and I can reproduce the same error wheneverI run msbuild from any directory other than where thefilesI'm trying to copylive(See ProjectX below). I'mwondering if there's a property in my VS project thatis needs to besetto make sure it knows the relative location ofall the projects in my solution. I do not get this error when I build within Visual Studio 8. The config file is copiedfine. Here's the error in my build. Target PostBuildEvent: copy "iVendSupportToolApp\*.config" "C:\views\hassij01_CVTG_Dev\CVTG_Common\Foundation\Canteen.Data\Canteen.Data.Common\bin\Release\" The system cannot find the path specified. C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Microsoft.Common.targets(3089,13): error MSB3073: The command "copy "iVendSupportToolApp\*.config" "C:\views\hassij01_CVTG_Dev\CVTG_Common\Foundation\Canteen.Data\Canteen.Data.Common\bin\Release\"" exited with code 1. Done building target "PostBuildEvent" in project "Canteen.Data.Common.csproj" -- FAILED. Of course I verified that the pathnames are all correct relative to the directory I kick off the build in. Here's my experimentation with the copy task. This is my project file to test the copy task.