views:

131

answers:

3

I have a solution in Visual Studio that is comprised of 5 projects. The projects build to assemblies (.dll). I have the output path of each project set to \my-web-server\wwwroot\bin, which works fine on one project. In the properties for all of my projects, I have the output path set to the same directory, but when I try building all but one of the projects, I get the error:

Unable to copy file "obj\Release\Index.dll" to "\my-web-server\wwwroot\bin\Index.dll". Access to the path '\my-web-server\wwwroot\bin\Index.dll' is denied.

I assume it could be an issue with permissions, because my organization keeps things locked down, but I have no control over granting permissions. Any help in the right direction is much appreciated.

A: 

Most likely a program is running using that library.

This happens to me when running something to debug, and I forget to close it (not attached to IDE debugger).

And since this looks like a website, it is potentially due to the website being hosted from the development build folder, and someone is accessing it.

Aequitarum Custos
I can't think of anything else that could be accessing the file. I even stopped the web site in IIS, then tried building while stopped. No go.
lush
A: 

Similar to what Aequitarum said, it's mostly likely a locked file because it's in use. Since you have multiple projects, you mostly likely have references between them. And since you have all the projects outputting to the same folder any of the referenced projects will most likely get copied more than once if you have those files set to be deployed in the child project. (In a C# web application, you can view the properties of the reference and look at the "Copy Local" property.) And if you have the MsBuild project set to use multiple processors for the build, two child projects are both trying to copy the file at approximately the same time and one is erring out.

It's a very unique situation, but it is possible.

Agent_9191
A: 

It must've been something silly. I deleted the .dll manually, then rebuilt. Looks like everything's working normally. Thanks.

lush