Getting InvalidProgramException on MSTest using vstest.console.exe

Category: visual studio unittest

Question

PedroLuz89 on Wed, 06 Jan 2016 15:31:36


I'm getting this weird InvalidProgramException when trying to call a static method from a static class that's in an external assembly.

I've already tried bringing the routine within the same assembly, but the result is the same.

Any ideas?


-Pedro Luz


Replies

Weiwei Cai on Fri, 22 Jan 2016 02:38:45


Hi PedroLuz89,

Sorry for the delay responce.

According to the error messag, it seems that the program you invoke is not recognized by MSTest. Please try run this test in Visual Studio directly, whether it can be run in Visual Studio?

Then please add a test settings file to let your test Run tests in 64 bit process on 64 bit machine, which can let your test run compatible with your program and computer environment.

In addition, please try comment the code in the TestHelper.Login() method one by one to check whether this problem caused by some code in that method.

Best Regards,
Weiwei