An exception occurred while invoking executor 'executor://mstestadapter/v1': Object reference not set to an instance of an object

白昼怎懂夜的黑 提交于 2019-11-29 13:24:12
Hamid Shahid

We got to the bottom of the problem. We are using Entity Framework 5.0 and we also have a situation where some of our test assemblies are targeting .Net 4.0 and some are targeting .Net 4.5.

When we are trying to run the tests such that assemblies targeting different versions of .Net framework and using Entity Framework 5.0 are run in the same Test (vstest.console.exe) process, we get this error.

I think this has to do with the way Entity Framework 5.0 ships with two versions (net40 and net45). Once one version of the library is loaded in the process, the other version cannot be loaded and this caused the error.

This is what worked for me: In Visual Studio, Test -> Test Settings -> Default Processor Architecture -> X64.

Though it might not solve everyone's issue, hope it helps some of you out there.

fabio bussu

I have the same error specified in the subject when in the AssemblyInfo of the project is specified the AssemblyAttribute:

[assembly: AssemblyCulture("en")]

If this attribute is present, the run of the unit tests fails. If I remove this line of code or I remove the en language, the run of the unit tests success.

I had the same error message just now with Visual Studio 2017 using the new MSTest.Framework and MSTest.TestAdapter (to be able to use Live Unit Testing). It turned out I was using multiple versions of those packages in my solution. Consolidating them to the latest version solved the problem.

An exception occurred while invoking executor 'executor://mstestadapter/v2'

I had multiple TestAdapter's and TestFramework's in my BuildAgents Folder, deleting the v1.1.11 versions fixed the issue:

I tried everything on the web to solve this exception. Finally I solved this issue by installing the Update v4 of Visual Studio 2013 (which is that I'm using currently). Hope it helps!

Deleting app.config and packages.config, if exists, and reinstalling Entity framework via nuGet packages works for me.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!