In order to generate XML documentation using Web API Help Pages for my Web API project, I had to check the "XML documentation file" option under the "Builds" section of my project's properties. This correctly generates the documentation when I build locally.
However, when I check in, I get the following error on the build server:
CSC: Error generating XML documentation file 'c:\Builds\3...\Sources\CurrentVersion...\ProjectName\App_Data\XmlDocument.xml' ('Access is denied. ')
I'm not sure why this happens, since it creates a new directory for each build anyway. I googled this issue and searched Stack Overflow, but the only solutions I found were to remove the XML documentation file (which defeats the purpose of using Web API Help Pages). How can I resolve this?
If the XML file is checked-in to TFS then when TFS gets the files to the workspace on the build server, it will have "Read-Only attribute" associated with the file. Now when the build generates the new XML file, it wont be able to overwrite the old XML file since it has the read-only attribute.
Solution is to: a) use your build scripts to modify the file attribute and make it read-write b) remove the xml file checked-in to TFS so that, build will be able to generate the XML easily.
Update: if you are using solution b, if the file is part of you project file make sure that you remove the file from the csproj file as well.
Removing the file from Source Control did not fix it for me, Team Server was still trying to access it.
I was able to solve it by Cloaking App_Data in the build definition.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With