Salient Solutions

wrasslin ones and nones for fun and profit - Sky Sanders' Blog
posts - 96, comments - 70, trackbacks - 0

Visual Studio 2008 Build Event XCopy Bug


Wondering why your post-build xcopy not working?

From Microsoft Connect

Thanks for reporting this bug. Unfortunately, after much investigation, we (MSBuild team) discovered that this is actually a documented bug in xcopy.exe. The owners of xcopy.exe claim that this bug is not worth fixing, and so there's not much we can do at this point.

However, the good news is that there is a fairly simple (though completely non-intuitive and non-discoverable workaround), and that is to append "<NUL:" to the end of your xcopy command. So, in your case, just do this:

    xcopy "$(TargetDir)*.*" "$(SolutionDir)..\bin\" /S /I /F <NUL:

and that should work for you.

If you want additional information about the bug, you can start by referring to the KB article at: http://support.microsoft.com/default.aspx?scid=kb;en-us;152134. Even though this article talks about calling xcopy from SQL server, it is really the same xcopy bug that is afflicting you in your Post-Build event.

Again, thanks for taking the time to report this, and sorry we're unable to fix this.

--MSBuild team (msbuild@microsoft.com)

 

These tasks are usually meant to overwrite files so I add '/Y':

 xcopy "$(TargetDir)*.*" "$(SolutionDir)..\bin\" /S /I /F /Y <nul:

Technorati tags: ,

Print | posted on Saturday, September 05, 2009 4:51 AM | Filed Under [ CodeProject-Tip ]

Feedback

Gravatar

# justin bieber

Thanks for a great time visiting your site. Pretty good post. I just stumbled upon your blog and wanted to say that I have really.

10/7/2010 9:35 PM | justin bieber
Gravatar

# IP Wireless Camera

I like your idea. Interesting post with valuable information you got here! I am really thankful for sharing this blog and time into the stuff you post!!Great to have the contact info.
10/11/2010 7:03 PM | IP Wireless Camera
Gravatar

# Burlap

Wonderful blog i like your post which is very useful for us.thank you for sharing this information.
10/13/2010 7:09 PM | Burlap
Gravatar

# Free VIN Check

I am really thankful for sharing this blog and time into the stuff you post!!Great to have the contact info.
10/14/2010 1:11 AM | Free VIN Check
Gravatar

# IP Camera

Thanks for a great time visiting your site. Pretty good post. I just stumbled upon your blog and wanted to say that I have really.
10/14/2010 5:29 PM | IP Camera
Gravatar

# re: Visual Studio 2008 Build Event XCopy Bug

Tried to install Visual Studio 2008. Install completed and it requested a reboot. After rebooting, there was no trace of VS 2008 in Program Files directory.
10/17/2010 9:38 PM | Walk In Coolers
Gravatar

# IP Wireless Camera

I like your idea.
Interesting post with valuable information you got here! I am really thankful for sharing this blog and time into the stuff you post!!
10/18/2010 11:41 PM | IP Wireless Camera
Gravatar

# re: Visual Studio 2008 Build Event XCopy Bug

There is lot of problem in installing this duh!
10/20/2010 5:26 AM | Solar PV
Gravatar

# re: Visual Studio 2008 Build Event XCopy Bug

thank you. the bug is now fixed.
10/20/2010 1:02 PM | lisa alloju
Gravatar

# chanel logo earrings

uable information you got here! I am really thankful for sharing this blog a
10/21/2010 1:13 PM | chanel jewelry
Gravatar

# re: Visual Studio 2008 Build Event XCopy Bug

Pretty Post.Thanks for sharing this information.
How you got this information please send me sites from where you collect this information,I am also searching information for my site.
10/21/2010 8:07 PM | Beds
Gravatar

# re: Visual Studio 2008 Build Event XCopy Bug

Visual studio will definitely helpful for those who is working on software development. Thanks for sharing it.
10/21/2010 11:58 PM | Risk Management

Post Comment

Title  
Name  
Email
Url
Comment   
Please add 2 and 2 and type the answer here:

Powered by: