none
MSB3073: exited with code 4

    Question

  • What is this ?

    I use this command in post-build event:


    xcopy $(SolutionDir)src\SomeSolutionFolder\SomeSubFolder\SomeProject\bin\$(ConfigurationName)\*.* $(SolutionDir)bin\$(ConfigurationName)\SomeSolutionFolder\ /C /F /D /Y /S

    And receive the error:

    C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Microsoft.Common.targets(3089,13): error MSB3073: The command " xcopy C:\SolutionDir\src\SomeSolutionFolder\SomeSubFolder\SomeProject\bin\Release\*.* C:\SolutionDir\bin\Release\SomeSolutionFolder\ /C /F /D /Y /S

    C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Microsoft.Common.targets(3089,13): error MSB3073: " exited with code 4.

     

    And where I can find information about MSB3073 and error codes ?

     

    Thank you in advance.

    Friday, August 03, 2007 8:32 AM

Answers

All replies

  • MSB3073 is just a generic error that means an Exec task returned a non-zero error code. 

     

    I suspect the problem is that you need double quotes around your paths:

     

    xcopy "$(SolutionDir)src\SomeSolutionFolder\SomSubFolder\SomProject\bin\$(ConfigurationName)\*.*" "$(SolutionDir)bin\$(ConfigurationName)\SomeSolutionFolder\" /C /F /D /Y /S

     

    xcopy exit codes can be found here: http://www.microsoft.com/resources/documentation/windows/xp/all/proddocs/en-us/xcopy.mspx?mfr=true.

     

    -Aaron

     

    Friday, August 03, 2007 2:51 PM
  • This may happen when you have a space in the path.

    xcopy $(SourcePath) $(TargetPath)  

    Wrap both source and target paths with double quotations (").
    xcopy "$(SourcePath)" "$(TargetPath)"  

    If you are using any bat file, update the file instead.


    Hope this would help.



    D.C

    ...on the deadline, project should be buried where it belongs...
    • Edited by D.C Monday, December 01, 2008 11:19 AM Correction
    Monday, December 01, 2008 10:59 AM
  • running TFS 2008 .proj file with XCOPY  for the deployment to the app server.  I am getting an MSB3073 with and exit error code of 4.

     

    The same project script works just fine going to the previous APP server.  So I know the script works.  The only change I made was the deployment location.  I can log into the build server and run the script from the DOS prompt successfully.  The problem has got to be in the security and permissions on the new deployment server, but I can't find it.  What are the requirements?
    Friday, January 30, 2009 6:40 AM
    • I have the same damned problem :(
    • Does anybody intend to help us?? :)
    Wednesday, March 18, 2009 12:20 PM
  • Alexandis, by same problem do you mean that you are trying to do an xcopy and are getting an rcode of 4?  If so, did you make sure that your paths have quotes around them? Any space in the path name will cause the copy to fail and return rcode 4. This can also be caused by a permission denied on the target location. Check to make sure that the login that the build is running under (normally a service login like NT SERVICE) has full permission on the target dir.
    mjlarezzo | Measure twice, cut once. Hee Hee. Hey, quit poking me!
    Wednesday, March 18, 2009 5:48 PM
  • If the line in the original post was pasted from his script, then you can see there are no spaces in this URL.

    In my original post the problem was a typo in the URL in the actual target drive directory names.  An extra space was introduced into the target directory name ( a double space between two words ).  This error was not reproduced in the Target URL in the build script.

    I found it by pasting the directory path and under that the URL from the script into a TXT doc for comparision.  At that point the extra space was easily visible.

    ===============================

    I got this error again today.  The message specifically stated the path was not good.  (though it does not state source or taget path)

    I immediately openned "My Computer" and pasted the offending URL from the script into the address box.  This demonstrates if the path is good or not.   The path worked. 

    I checked with the IT admins and found they had a connections issue in the network last night between 8pm and 8am.  Hence, at  the time of my nightly build, the URL was unreachable.  A rebuild this morning ran normally.

    ===============================

    Still would like to find a comprehensive list of the security and permissions requirements for all entities involved in the processes in TFS.
    Thursday, March 19, 2009 6:03 PM
  • p.s. Problem is solved - i had to add 'Everyone' user to 'Full access' (i am making tfs build to another machine in LAN, but we trust each other, otherwise, as i understand, i should create the same account (that would be used for TFS build run) on all relevant LAN machines and Active Directory would take care of all)
    • Proposed as answer by DeSClark Tuesday, September 28, 2010 1:19 PM
    Wednesday, May 06, 2009 9:31 AM
  • This worked for me....adding Everyone with full access security to the destination folder (in my case, I was using this as a post-build script in visual studio 2010 to a destination dir on the same machine)....thanks Alexandis!
    Tuesday, September 28, 2010 1:18 PM
  • if you dont like to add Everyone full access you can change the post build line from "xcopy [source] [dest]" to "start xcopy [source] [dest]". The start parameter explicitly starts a new window to perform the operation, thus cating it with your Administrator privileges
    • Proposed as answer by klaus4040 Sunday, February 27, 2011 1:43 PM
    Tuesday, February 08, 2011 11:17 AM
  • Thanks.  This was a far better approach.  I couldn't even get it to work with "Everyone".  The individual who had the machine before me did some pretty weird things to the folder permissions structures.
    Monday, March 14, 2011 11:51 PM
  • Thanks a lot. Adding the quotes working for me. I am using xcopy in DNN Development to copy the module to the website. Just throwing it in there for future reference for others
    http://ssis-stuff.blogspot.com
    Friday, March 18, 2011 2:31 PM