Sorry about the multipost, but I realized too late after I posted to
m.p.d.l.c# that my question might be more appropriate in this group.
I have two C# projects: a production project and NUnit tests for it.
I've recently added a test that causes a call into a registered COM
component, and now the test fails with a TypeLoadException when it
tries to load the interop assembly.
However, when I use the TestDriven.NET addin -- run via either
Debugger or In-Proc -- the test runs fine.
In trying to get a better idea of the problem, I found Suzanne Cook's
blog. I tried examining the Fusion log, but all it shows are attempts
to load nunit.uikit, not the interop assembly that the exception
complains about.
Catching the exception and probing a little, I see the following:
Could not load type TACGRAPHDOCLib.TGDocumentClass from assembly
Interop.TACGRAPHDOCLib, Version=1.0.0.0, Culture=neutral,
PublicKeyToken=null.
at AIM.Jvmf.CJvmfK05_17Message.GetXml()
at JvmfUnitTests.K0517GetXml.NoModifierDuplicates() in
...\k0517getxml.cs:line 41
No InnerException.
HRESULT = 0x80131522
I searched for other people reporting problems related to that hresult,
but the hits were VB issues, and none of the advice they got seemed
applicable to my situation.
I tried messing with the reference from the NUnit project to the COM
component, i.e., directly as a COM reference, browsing to the production
project's copy of the interop assembly, and cutting it out. No joy.
The fact that I can run the test without exception through TD.NET must
be a clue -- or at least a Scooby snack. I'd appreciate any guidance
the group might offer, even if it's only for ways to find more verbose
debug information.
Thanks,
Greg
Greg Bacon - 16 Jun 2005 19:16 GMT
: [...]
: Catching the exception and probing a little, I see the following:
[quoted text clipped - 7 lines]
: No InnerException.
: HRESULT = 0x80131522
As a shot in the dark, I printed Environment.CurrentDirectory in that
catch block. It turns out that pwd was the build directory of another
test project in that solution.
To check, I copied the interop assembly to that directory, and the test
executed happily from NUnit GUI, so it appears that I've hit an NUnit
problem.
Thanks,
Greg