Error Generating Xml Documentation File Access Denied Visual Studio
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about Stack Overflow the company Business Learn more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 4.7 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up Build fails because of xml documentation error up vote 7 down vote favorite I am trying to build a ASP.NET MVC 2 project that uses Lucene.Net. I make a standard build definition in TFS 2010. When I queue a new build, it fails on this error: CSC: Error generating XML documentation file 'xxx\xxx\Lucene.Net.xml' ('Access is denied. ') But in my project properties for Lucene, I don't have xml comments checked. How can I get this to build correctly? I don't care about xml document files! tfs2010 tfsbuild share|improve this question asked Sep 1 '10 at 20:08 Rick Ratayczak 1,25611126 add a comment| 2 Answers 2 active oldest votes up vote 14 down vote I had the same problem. In my case it was caused by having bin\Release\[Assembly Name].xml in project Source Control. In build Sources location the [Assembly Name].xml was marked as readonly and CSC cannot override it. Solution is to remove [Assembly Name].xml file from Source Control, or set Cloak in Workspace option of Build definition. share|improve this answer answered Jan 17 '11 at 14:30 HolaJan 459411 add a comment| up vote 3 down vote accepted Got it. Unchecked it on release build config, and all is fine. share|improve this answer answered Sep 1 '10 at 20:53 Rick Ratayczak 1,25611126 can you maybe add a little more detail with your answer? I
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about Stack Overflow the company Business Learn more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 4.7 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up How can I prevent Visual Studio from locking the xml documentation files in the bin directory? up vote 17 down vote favorite 5 http://stackoverflow.com/questions/3621761/build-fails-because-of-xml-documentation-error 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." http://stackoverflow.com/questions/1167608/how-can-i-prevent-visual-studio-from-locking-the-xml-documentation-files-in-the 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? msbuild locking xml-documentation share|improve this question asked Jul 22 '09 at 19:25 SteveBering 54711030 add a comment| 5 Answers 5 active oldest votes up vote 1 down vote accepted 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. share|improve this answer edited Nov 14 '09 at 2:40 answered Nov 14 '09 at 2:32 Kevin Kibler 7,70862656 add a comment| up vote 8 down vote I've found the following solution: In VS postbuild event or in NAnt/MSbuild script execute the cmd script handle.exe -p devenv [Path to the folder with locked files] > handles.txt FOR /F "skip=5 tokens=3,4 delims=: " %%i IN (handles.txt) DO handle -p %%i -c %%j -y handle.exe is available here http://technet.microsoft.com/en-us/sysinternals/bb896655.aspx first line of the
only turn http://weblogs.asp.net/mnolton/354624 this feature on when I am creating a release build. However, if you do this make sure that you turn-off the https://github.com/microsoft/visualfsharp/issues/57 read-only property on the output xml file. Failure to do so can will cause your build to fail. This happened error generating to me recently with a rather large solution set and I could not for the life of me figure out why all of a sudden when I switched to release build my solution set failed to build properly. If it was error generating xml just a single project solution or a small solution set, it might have appeared obvious. It was only after I did a 'clean' of my obj and dll files that I was able to see that it was unable to write the output xml file that the error became more pronounced in my output. I quickly turned off the read-only attribute and it finally built. I hit this problem a while ago...but my memory must be fleeting. Note to self: When doing a release build make suretoturn off the read-only attributes on the generated xml file (I keep this file in source safe with the rest of my project files). -Mathew C. Nolton No Comments Terms Of Use - Powered by Orchard
Sign in Pricing Blog Support Search GitHub This repository Watch 215 Star 850 Fork 212 Microsoft/visualfsharp Code Issues 282 Pull requests 32 Projects 0 Wiki Pulse Graphs New issue Visual Studio locking access to xml doc files #57 Closed eiriktsarpalis opened this Issue Jan 19, 2015 · 40 comments Projects None yet Labels bug Milestone No milestone Assignees No one assigned 19 participants eiriktsarpalis commented Jan 19, 2015 This is a common annoyance when using Visual Studio together with FAKE. Running a FAKE build while the solution is open in Visual Studio invariably results in the following error: FSC : error FS0193: Access to the path 'path_to_bin_folder\project.XML' is denied. ['path_to_project\project.fsproj'] The error persists even if the solution is closed from within Visual Studio. The IDE needs to be restarted in order for the problem to go away. forki commented Jan 19, 2015 yes this is a major annoyance theimowski commented Jan 19, 2015 👍 forki commented Jan 19, 2015 any ideas where we need to look? braden commented Jan 19, 2015 I have noticed this also happens occasionally when project files change externally and VS reloads them, unrelated to FAKE. I had suspected F# Power Tools, maybe there is something in common? latkin added the bug label Jan 19, 2015 dsyme commented Jan 19, 2015 I'd love to see this fixed, I've seen it somewhat randomly when compiling quite a range of projects with Visual F#. ovatsus commented Jan 19, 2015 I've also seen this. On F# Data I went to some trouble to try to not lock the .dll files, but then the .xml file is still locked :/ fsharp/FSharp.Data@8734a17 latkin commented Jan 21, 2015 Curious - does this seem to affect only F#, or has anyone experienced it with C#, too? Would also be good to know if this is a long-standing problem, or has this been the case for multiple VS releases? ovatsus commented Jan 21, 2015 This problem has existed at least since VS2012, and I never saw it in C# dungpa commented Jan 22, 2015 According to this answer http://stackoverflow.com/questions/6515795/why-is-my-xml-doc-file-always-getting-locked, this code fragment supposes to fix the bug https://github.com/Microsoft/visualfsharp/blob/fac44095a8dbc7303efa9866e0e2d9dddbdeae5d/vsintegration/src/vs/FsPkgs/FSharp.Project/Common.Source.CSharp/Project/ProjectConfig.cs#L1877-L1896. I'm not sure there is any regression here. Is there any historical note elsewhere about this bug? For now, this answer seems like a reasonable workaround http://stackoverflow.com/a/3969978. rojepp commented Jan 26, 2015 @dungp