0

No code examples for this one, just an overall question:

Is there a good way to test that the GAC matches the config references, which match the dlls built for deployment?

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.

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.

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.

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.

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.

Max A.
  • 1
  • 1
  • "Unit test" is not. You should be able to easily develop integration test cases using Docker images, a script to automate the assembly acquisition, and assert if a sample application runs or crashes. – Lex Li Jul 26 '18 at 21:25
  • I agree that it's not. The initial ask to me was for unit tests, and I've already determined that that's not the approach. I made the mistake of mentioning what I already tried with this, I guess. I don't know if an associative test of a different application with the same assemblies is a valid solution, as it's not testing our code, in our environment, under our conditions, it's testing some other code, in our environment, under some other conditions. I could reasonably assure someone that the sample app works, but that doesn't correlate to how our actual application works. – Max A. Jul 27 '18 at 14:12

0 Answers0