title: .NET Reference "Copy Local" True / False Being Set Based on Contents of GAC
body: <p>We had a very interesting problem with a Win Forms project. It's been resolved. We know what happened, but we want to understand why it happened. This may help other people out in the future who have a similar problem.</p>
  
  <p>The WinForms project failed on 2 of our client's PCs. The error was an obscure kernel.dll error. The project ran fine on 3 other PCs.</p>
  
  <p>We found that a .DLL (log4net.dll - a very popular open-source logging library) was missing from our release folder. It was previously in our release folder. Why was it missing in this latest release?</p>
  
  <p>It was missing because I must have installed a program on my Dev box that used log4net.dll and it was added to the Global Assembly Cache.</p>
  
  <p>When I checked the solution's references for log4net.dll, they were changed to "copy local=FALSE". They must have changed automatically because log4net.dll was present in my GAC. </p>
  
  <p><strong>Here's where my question starts:</strong></p>
  
  <p>Why did my reference for log4net.dll get changed from COPY LOCAL = TRUE to COPY LOCAL = FALSE? I suspect it's because it was added to my GAC by another program. </p>
  
  <p>How can we prevent this from happening again? As it stands now, if I install a piece of software that uses a common library and it adds it to my GAC, then my SLNs that reference that DLL will change from Copy Local TRUE to FALSE.</p>