title: Automated Testing Of Assembly References And Bindings
body: <p>No code examples for this one, just an overall question:</p>
  
  <p>Is there a good way to test that the GAC matches the config references, which match the dlls built for deployment?</p>
  
  <p>My team has been in the process of upgrading .NET across our application and we've encountered several issues relating to hanging dlls and mismatched references, which are causing a lot of problems at deploy time. These don't pop up locally whether building in Debug or Release, although we can run through the output and find reference errors, but only seem to break functionality after deploying to one of our environments.</p>
  
  <p>The errors themselves aren't too hard to find using FusionLog, and we can go through the build output to see some of the errors as well. We've set up alerts through logz.io to tell us when assembly references are mismatched, but I've been tasked with finding a way to potentially automate discovery for these discrepancies before it gets out to a server somewhere.</p>
  
  <p>I looked into possibly creating a suite of unit tests to validate the references, but found that the Assembly through reflection is only giving me access to the actively running code, and not an application-wide source, and CurrentDomain assemblies (within the context of the unit tests) are only representative of the unit test and some of our required framework.</p>
  
  <p>The last-ditch effort for this will be to make something to parse the configs and audit it against the bin or another output directory, but this seems cumbersome and prone to error, and is still a solution that requires us to deploy something before we see the issue, which is just wasted time. </p>
  
  <p>I'm happy to provide more context if necessary, but this is my first foray into assemblies and their innards so your questions might prompt more questions from me. I appreciate any help or insight into a potentially automated process for testing this, even if it's just a push in the right direction. I haven't had much luck googling an existing test or process for this, so I'm flying by the seat of my pants here.</p>