Shared .Net dll / Access to the path 'bin\Release\ is denied

374 Views Asked by At

I am having an issue with sharing dlls between projects and building the solution afterward. To be brief I'll give two project examples. 'MyWebProject' and 'MyService'.

I am using Vault as a source control, which has a feature to share the same .dll to other folders within a repository. So, 'MyService' is checked in and serves as the source of truth for all of the other projects that it has been 'shared' with.

This particular web project's solution also contains the service project, so if it were the only project using 'MyService', I could remove the bin/Release folder from Vault and be fine, but other solutions may depend on the 'MyService' project.

Since 'MyService' does have the Release folder in Vault, I get the following error when I am trying to build the MyWebProject/MyService's solution in release mode:

Error   1   Unable to copy file "obj\Release\MyService.dll" to
"bin\Release\MyService.dll". Access to the path
'bin\Release\MyService.dll' is denied.

If I delete 'MyService.dll' from 'MyService/bin/Release' in my working folder, checkout the release folder contents and rebuild, then the error will go away, and I can check in my solution's changes.

Another means of addressing the error is to set the folder to not be read-only,(which actually can lead to other Vault issues), but both this and just deleting the .dll before building in release mode every time seem like an annoying work around, and not the ideal solution..

Should I be sharing in Vault differently, or is there another way to address the issue permanently, without having to remember a workaround everytime?

0

There are 0 best solutions below