Nunit no puede encontrar el ensamblado de C++

I am working on .NET 4 application which uses a VS2005 C++/CLI library. The tests around the C++/CLI library are custom console based test runners and are a little clunky. I have been trying to write some new tests using nunit.

The problem is that the console based application can load all dependent assemblies but Nunit complains that it cannot find assemblies (e.g. System.Runtime.Serialization.SerializationException : Unable to find assembly 'msvcm80, Version=8.0.50727.6195, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a').

I have ascertained that the console based application is loading the assembly at C:\Windows\winsxs\x86_microsoft.vc80.crt_1fc8b3b9a1e18e3b_8.0.50727.6195_none_d09154e044272b9a\mscvm80.dll and copied this file manually to the build directories and the test runner directory. This does not help.

Depends.exe tells me that GPSCV.DLL and IESHIMS.DLL cannot be found but that doesn't stop the console app from loading the dependencies so not sure if that is important.

Has anyone any tips on troubleshooting Nunit tests which have dependencies older C++/CLI libraries?

preguntado el 31 de julio de 12 a las 11:07

I am not sure if this is relevant, but do you have .NET 2.0 installed on your computer? Also, would you be able to rebuild your C++/CLI library to target .NET 4 instead? -

Thanks, I don't have the .NET 2.0 runtime installed in Windows 7 Programs and Features. I'll install and see if that works any magic. Recompiling for .NET 4 makes sense as well (there may be some horrible other .NET 2 dependency in there but won't know until I try it out!). -

1 Respuestas

When I ran the nunit executable to the build output path my new tests ran successfully in nunit.

It looks as if this issue is simply a case of needing the required C++ DLLs in the same path as the nunit runner (or at least accessible to nunit). What is confusing is that the Module load exception thrown when the test is run from nunit run in another location names an assembly (msvcm80.dll) that is not required in the nunit path. The dependency tree is a little opaque for me anyway and this caused me alot of confusion.

The annoying thing about this is that I have to call nunit console through a batch script in Team City to run CI tests for this assembly rather than in the Team City nunit test runner (as we do for all the other tests).

Respondido 03 ago 12, 15:08

First, are you using the latest NUnit? (2.6.1 right now). I do recall having seen bug reports about managed-unmanaged interactions. Second, you can get Team City to pick up the test results and display them just like it does for the Nunit runner. Check esta pregunta. - dario_ramos

No es la respuesta que estás buscando? Examinar otras preguntas etiquetadas or haz tu propia pregunta.