调用执行程序“executor://mstestadapter/v1"时发生异常:未将对象引用设置为对象的实例 [英] An exception occurred while invoking executor 'executor://mstestadapter/v1': Object reference not set to an instance of an object

查看:14
本文介绍了调用执行程序“executor://mstestadapter/v1"时发生异常:未将对象引用设置为对象的实例的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们在项目中使用 Visual Studio 2012 和 Team Foundation Server 2010.由于我们使用的是 Microsoft Fakes,因此我们无法使用 Team Build 2010 的已启动测试功能,因此我创建了一个构建活动,它调用 VSTest.Console.exe 并传递测试程序集.这种方法对我们来说效果很好.但是,在最近签入后,我们在执行 Vstest.console.exe 时出现以下错误

We are using Visual Studio 2012 and Team Foundation Server 2010 in our project. Since, we are using Microsoft Fakes, we could have not used the started Test functionality of our Team Build 2010, I have created a build activity which invokes VSTest.Console.exe passing the test assemblies. This approach has been working well for us. However, after a recent check-in we are getting the following error when executing Vstest.console.exe

错误:调用执行程序executor://mstestadapter/v1"时发生异常:未将对象引用设置为对象的实例.

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

我将二进制文件复制到我的本地机器,并且能够再次出现错误.有趣的是,我们在签入之前运行了一个开发版本,它运行具有相同参数的相同 vstest.console.exe 并且可以正常工作.我的机器上有两个文件夹,一个可以正常通话,而另一个则不行.编译后的程序集看起来大小相同,建议没有太大差异.

I copied the binary files to my local machine and was able to get the error again. Interestingly, we run a dev build before check-in which runs the same vstest.console.exe with the same parameters and that works correctly. I have got two folders on my machine, for one the call works fine and for other it doesn't. The compiled assemblies look same size and there aren't much differences to suggest.

我尝试使用进程监视器,但除了进程返回退出代码 1 之外找不到任何明显的东西.有人对这个错误了解很多吗?有什么办法可以从我的测试运行中找到更多信息?

I tried using Process Monitor but couldn't find anything obvious other than that the process returns with an exit code 1. Does anybody know much about this error? Is there any way I can find out more information from my test run?

问候,

哈米德

推荐答案

我们找到了问题的根源.我们正在使用 Entity Framework 5.0,我们也遇到了一些测试程序集面向 .Net 4.0 和一些面向 .Net 4.5 的情况.

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.

当我们尝试运行测试以便在同一测试 (vstest.console.exe) 进程中运行针对不同版本的 .Net 框架和使用实体框架 5.0 的程序集时,我们会收到此错误.

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.

我认为这与 Entity Framework 5.0 附带两个版本(net40 和 net45)的方式有关.一旦在此过程中加载了一个版本的库,另一个版本就无法加载,从而导致错误.

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.

这篇关于调用执行程序“executor://mstestadapter/v1"时发生异常:未将对象引用设置为对象的实例的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆