Fixing ASP.NET Web Publish File Copy Issue in Visual Studio 2012
If you are encountering issues with copying files during ASP.NET web publishing in Visual Studio 2012, don't worry! There is a solution to this problem.
The issue occurs when you attempt to publish your ASP.NET web application in Visual Studio 2012, and the process fails due to the inability to copy files to the target location. This can be frustrating, especially if you are on a tight deadline!
The solution to this issue is to modify the project file (.csproj or .vbproj) and add the following line of code:
This code should be added within the
<Project> tag, but not within any other tags.
Once you've added this line of code, save the project file and attempt to publish your ASP.NET web application again. The file copy issue should now be resolved!
Why it works
UseMsdeployExe property forces Visual Studio to use the msdeploy.exe executable to copy files during web publishing. This executable is more reliable than the built-in file copy functionality in Visual Studio, and should resolve any issues you may be experiencing.
So there you have it - a simple solution to a frustrating issue! Happy publishing!