Strong Name Validation Failed while running C# app in custom AppDomain from unit test

0

I have a program that make use of unmanaged C++ code, and I want to write Unit Tests (well, more like system tests) for it.

I want to run the entire program from the Unit Test in a different AppDomain, so I'll be able to more easily inject tester code.

Problem is, when I try to run it, I get this error:

The C++ module failed to load while attempting to initialize the default appdomain
(source: my own code)

Inner Exception:

Strong name validation failed. (Exception from HRESULT: 0x8013141A)
(source: msvcm90)

I use the MSTest as testing environment.

I already tried altering some app.config files, but maybe the wrong ones. I also tried using the AppDomainSetup object, but I don't know what to configure there to prevent it from performing strong name check.

I'm launching the app from the unit test using AppDomain.ExecuteAssembly.

Edit

The latest thing I've tried is to use appDomain.CreateInstanceAndUnwrap to load a proxy class I made, that also implements MarshalByRefObject. The proxy class loads fine, but in it I try to call the function which starts the initialization and runs the actual code I want to test, and the above error still occur.

I've tried using fuslogvw.exe but I don't get anything from it. I guess it is because what fails is loading of an unmanaged DLL.

c#
unit-testing
appdomain
strongname
asked on Stack Overflow Dec 22, 2014 by Itai Bar-Haim • edited Dec 23, 2014 by Itai Bar-Haim

0 Answers

Nobody has answered this question yet.


User contributions licensed under CC BY-SA 3.0