I received a question recently about my post on Checking for a Valid Strong Name Signature. The person who was using the code I presented there to run some tests under NUnit. The format of the tests was to use the Microsoft.Win32.Registry classes to set the skip verification list up, and then call StrongNameSignatureVerificationEx. However, he found that this wasn't working.
The reason behind this is that the CLR is free to cache any settings that it looks up in the registry and environment. This could occur at any point from the time that the CLR is first spun up, to the point that you request the value of the setting. In order to ensure that the settings you are creating are honored by the CLR, you need to kick off a new process. So the NUnit tests should use the following algorithm: