Today I was having some trouble with visual studio unit tests. First, I kept on getting a "could not load assembly" error. The problem here was difficult to track because of the way assemblies are loaded. The test project references the assembly as another project, and the new assembly was built correctly, and located right in the debug folder. However, the assembly was also installed to the GAC, and the tests were trying to load the old assembly in the GAC, and failing. I installed the new assembly to the GAC, and everything worked fine.
The second problem was that I kept on getting a System.MissingFieldException. I thought it was the same problem (and it probably was, in a way), so double checked that I installed the new assembly to the GAC before running the test. However, the exception kept coming up, and I didn't understand why. Then, I hit debug on the test so that I could maybe get some more information, and suddenly the test worked. I'm not really sure why this happens, but if you get tripped up on the assembly not refreshing, even after you reinstall it, then try using the debug mode.

