Posts Side effect of shadowCopyBinAssemblies in web.config
Post
Cancel

Side effect of shadowCopyBinAssemblies in web.config

Today while developing I ran into the problem saying something like “the assembly exists at two location”. I, normally used to solve this problem by deleting the files from “Temporary ASP.NET Files”, but this error started to appear too often. So I googled on this error and found someone saying you need to put the following code of line in web.config file if you are running accross this error too often,

<hostingEnvironment shadowCopyBinAssemblies=”false” />

hostingEnvironment  : Defines configuration settings that control the behavior of the application hosting environment.

shadowCopyBinAssemblies : Optional Boolean attribute. Sets a Boolean value indicating whether the assemblies of an application in the Bin directory are shadow copied to the application’s ASP.NET Temporary Files directory.

After placing this part of code in my web.config file, I got rid of the above problem, But I came accross another one which irritated me more. As my application had multiple projects, I frequently have to make changes in one of those, build it and then again add the refrence to my web application.

But after placing this line in my web.config I was not able to remove the previously added reference. When I tried to add reference to new DLL it threw an error something like this “cannot delete or modify as file is already is in use by another process. Access denied” . Later when I removed this line from my web.config I was releaved of this error, phew!!!

This post is licensed under CC BY 4.0 by the author.