简体   繁体   中英

Installed Nuget package for System.Web.Optimization, keep getting error copying the System.Web.Optimization.xml file.. access denied

I'm implementing Minification and Bundling in my asp.net MVC3 application. I installed the nuget package for System.Web.Optimization 1.1.3.

Now when I build it will build ok for a bit then I get this error:

Error 312 Unable to copy file "D:\\TFS\\CIS3G_3_34\\packages\\Microsoft.AspNet.Web.Optimization.1.1.3\\lib\\net40\\System.Web.Optimization.xml" to "bin\\System.Web.Optimization.xml". Access to the path 'bin\\System.Web.Optimization.xml' is denied. CIS3G

Once I get that error I can't build. I looked and the file is locked by the vs2010 ide. If I close the ide, I can delete the file and it works for a little while again, then it gets stuck agian, but that's a huge pain.

Copy local on the reference to the dll is set to true, but I don't understand why it's copying the .xml file too.

I didn't add anything fancy like custom build events or anything like that... The problem started after I'd compiled the sln with the nuget package added a few times.

Anyone know why the xml file is beign copied? no other xml for a dll gets copied.. If I can stop that I think I'll be golden again.

Barring that, does anyone know why the IDE keeps locking it?

What is the purpose of the XML file that matches my DLL in the nuget package?

The solution was simple as I resolved in this way:

I cleaned solution and rebuild the project and it was resolved. If it does not go this way for you, Close Visual Studio and reopen and again clean the solution and rebuild the solution then it will be resolved.

It's been longer than i should have waited, so I'm a little fuzzy on specifics, but I closed the .sln, stopped IIS, and then deleted the file.. then the error went away for a while... at which point I'd repeat. Sorry I'm not more precise.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM