Hi
all,
Has somebody
encountered this problem:
Step
1:
I have a NUnit test
that does remoting. Running the test stand-allone (No NUnit, No nant)
works fine.
Step
2:
Then I used NUnit
and I got:
Exception:
System.InvalidCastException
Message:
Return argument has an invalid type.
Stack trace:
at System.Runtime.Remoting.Proxies.RealProxy.ValidateReturnArg(Object arg, Ty
pe paramType)
Message:
Return argument has an invalid type.
Stack trace:
at System.Runtime.Remoting.Proxies.RealProxy.ValidateReturnArg(Object arg, Ty
pe paramType)
Diagnosis: NUnit did
not load the assemblies referred by the test dll and therefor did not
know some type that was to returned by the remote proces.
Solution: Explicitly
load assemblies with Assembly.Load(---) in the test.
Result: It worked
again.
Step
3:
I run the modified
test from nant and I get the same exception again. The assembly loading is done
explicitly but still the types are not known.
Solution after trial
and error: Put a copy of assemblies in the bin directory of nant and it works
again.
Does someone
understand why it did not work in the first place from nant? And
why putting a copy of the assemblies in the nant bin makes a difference?
And is there a more elegant way to solve this problem?
Regards,
Henk