Hi all,
I am trying to port solution from vs2005 to vs2008, every thing works
well except the unit test.
My solution containes C#, C++/clr (C++/CLI), and C++ native. I would
like to test a C# project which has C++/clr dependency. My assembly is
build from
severals netmodule, some writtens in C#, some in C++/CLI.
When I launch the test from Visual. I got an exception (see exception
stack below).
Actually, if I use mstest and /noisolation, IT WORKS!
I am not sure of understanding this magical argument. MSDN say : "Run
tests within the MSTest.exe process. This choice improves test run
speed but increases
risk to the MSTest.exe process".(http://msdn.microsoft.com/en-us/
library/ms182489.aspx)
But in my case, there is not just a matter of speed! It affects the
test process.
So my question is:
How can I avoid the noisolation argument and sucessfully pass my
tests?
Thanks for your replies!
Error message:
Test method
InScan.Infrastructure.Test.SSDPcbElementAlignerTest.AlignOutOfBoundsTest
threw exception: System.TypeInitializationException: The type
initializer for '<Module>' threw an exception. --->
<CrtImplementationDetails>.ModuleLoadException: The C++ module failed
to load while attempting to
initialize the default appdomain.
---> System.IO.FileNotFoundException: The system cannot find the
file specified. (Exception from HRESULT: 0x80070002).
stack trace:
System.Runtime.InteropServices.Marshal.ThrowExceptionForHRInternal
(Int32
errorCode, IntPtr errorInfo)
DoCallBackInDefaultDomain(IntPtr function, Void* cookie) in
f:\dd\vctools\crt_bld\self_x86\crt\src\minternal.h: line 447
DoCallBackInDefaultDomain(IntPtr , Void* )
DefaultDomain.Initialize()
LanguageSupport.InitializeDefaultAppDomain(LanguageSupport* )
LanguageSupport._Initialize(LanguageSupport* )
LanguageSupport.Initialize(LanguageSupport* )