How can I prevent Visual Studio from locking the xml documentation files in the bin directory?
locking, msbuild, xml-documentation
Solution
I've had this problem with Visual Studio, too. We use NAnt instead of MSBuild, but the problem is the same. I was able to work around it by modifying the build file to ignore failures when copying xml documentation.
Note that this doesn't actually solve the original problem since the xml files are still locked, but this workaround was good enough for us since the actual content of our xml documentation doesn't change very often.
Problem
My visual studio solution includes a web application and a unit test application. My web application uses log4net. I want to be able to use msbuild from the command-line to build my solution. However, whenever I build the solution from the command-line, I get build errors because it can't copy log4net.xml to the test project's bin directory. The error message is: "Unable to copy file '\bin\log4net.xml' to 'bin\Debug\log4net.xml'. Access to the path '\bin\log4net.xml' is denied." It looks like Visual Studio is locking this file, but I can't figure out why it would need to. Is there a way to prevent VS from locking the XML documentation files in a project that it has loaded?