OK Markus, I found the issue.
I have multiple projects in my main test solution with the first one being the core project. All other projects are including it as a reference. The core has the DLL as a direct reference, but the others do not. They are all indirectly referencing the DLL through the CORE.
This has always worked fine as long as I keep the DLL modules in test cases because the core project (and the DLL, indirectly) was initialized by then, but when I added a couple of the DLL's modules directly to the Suite's SETUP area, before the DLL is used anywhere else, it started doing this.
If I add the DLL as a direct reference this works, but if it is an indirect reference it doesn't.
I still think that it is a bug. If the indirect reference works in the test cases (which it does) then it should work anywhere, even in the suite's SETUP area, even if this is the first use of the indirect reference.
So, to reproduce this, I've created a suite that demonstrates the issue. The CORE project will run fine since it has the direct reference to the DLL, but the FAILURE project will throw the exception because it has the indirect reference before the DLL is initialized. If you move the modules into the test case it will work though (SUCCESS project), but only if I reference the DLL in one of the modules from the CORE project before the user code.
All of these should work.
Attached is a ZIP that contains both the DLL solution and the test solution (with 3 projects, CORE, FAILURE, SUCCESS).
- (46.28 KiB) Downloaded 61 times
Shortcuts usually aren't...