不能运行在VS2012测试测试

2023-09-03 06:32:29 作者:绿衣。

有没有人遇到下面的错误尝试运行在Visual Studio防爆preSS 2012单元测试网页的时候?

Has anybody run into the following error when trying to run unit tests in Visual Studio Express 2012 For Web?:

MSTestAdapter无法发现测试,因为经典的模式帮助不可用。如果TestSettings文件已被选中,取消选中,然后重试。

MSTestAdapter could not discover the test because the classic mode helper is not available. If a TestSettings file has been selected, unselect it and try again.

我在Visual Studio 2012 RC的解决方案,其中包含了几个应用程序,一些类库,和几个单元测试项目。当的Visual Studio 2012发布后,我改变了以防爆preSS对于Web。一切的编译和运行良好,但任何时候我尝试运行单元测试,我得到上述错误。

I had a solution in Visual Studio 2012 RC which contains a couple of applications, several class libraries, and a couple of unit test projects. When Visual Studio 2012 was released, I changed over to Express For Web. Everything's compiling and running fine, but any time I try to run unit tests I get the above error.

作为测试,余卸载单元测试项目和除去TestSettings文件并增加了新的单元测试项目与一个测试,这是一个简单的真断言。然而,错误仍然存​​在。

As a test, I unloaded the unit test projects and removed the TestSettings file and added a new unit test project with one test, which is a simple true assert. However, the error persists.

谷歌搜索尚未打开了很多的事情对我来说。各种网站上,但没有实质性的一些相关的帖子,只是还没有。 (也许别人已经有更多的运气?),它看起来像测试框架失败之前,甚至试图调用MSTest的,但什么也好奇的是,我无法找到 mstest.exe 在机器上。

Googling hasn't turned up much of anything for me. A few related posts on various sites, but nothing substantial just yet. (Maybe somebody else has had more luck?) It looks like the test framework is failing before it even tries to invoke MSTest, but what's also curious is that I can't find mstest.exe on the machine.

有没有人遇到这一点,解决它?我想我可以移动到NUnit的(虽然他们的网站没有响应,不灌输了不少信心在项目)或类似这种事情的,不过我倒是preFER保持工具的数量下降在可能的情况

Has anybody run into this and solved it? I suppose I could move to NUnit (though their website isn't responding, which doesn't instill a lot of confidence in the project) or something of that nature, though I'd prefer to keep the number of tools down where possible.

推荐答案

我有同样的问题。我已经删除了一些测试设置文件,它是现在的工作。 要删除文件:

I was having the same problem. I have deleted some test settings files and it is working now. Files to be removed:

Local.testsettings

Local.testsettings

SOLUTIONNAME.vsmdi

SOLUTIONNAME.vsmdi

TraceAndTestImpact.testsettings

TraceAndTestImpact.testsettings

步骤:

从溶液中取出所有3个文件 VS2017突然无法调试运行单元测试了

Remove all 3 files from the solution

删除解决方案文件夹的所有3个文件

Delete all 3 files from the solution folder

关闭VS12的解决方案,并重新打开它

Close the solution in VS12 and reopen it

http://dailywebtips.blogspot.co.uk/2012/09/visual-studio-2012-ex$p$pss-error.html