简体   繁体   English

Visual Studio 2012 express for Web不运行单元测试

[英]Visual Studio 2012 express for Web doesn't run unit tests

I have ac# project created in VS2010 and then imported into 2012 express (web). 我在VS2010中创建了ac #project,然后导入到2012 express(web)。 When I build it, however, the unit tests don't run. 但是,当我构建它时,单元测试不会运行。 Going into the test explorer gives me the option to hit "run all", which simply causes the build to run again without the tests. 进入测试资源管理器后,我可以选择“全部运行”,这只会导致构建在没有测试的情况下再次运行。

thinking it may be caused by the import I created, in 2012, a new project in the solution as a unit test project, with a simple test (asserting true==false). 我认为这可能是由于我在2012年创建的一个新项目,作为一个单元测试项目的解决方案,通过一个简单的测试(断言true == false)。 This shows up in the solution explorer with the correct icon. 这会在解决方案资源管理器中显示正确的图标。 however, no amount of building/rebuilding/cleaning has yet caused this test to run either. 然而,任何建筑/重建/清洁的数量都没有导致该测试运行。

I have update 3 installed, and have changed nothing to my knowledge that would affect the tests. 我安装了更新3,并且根据我的知识改变了任何会影响测试的内容。 Anyone know what's wrong? 谁知道什么是错的?

EDIT: I created a new solution containing nothing but a single unit test (for true==false ) this runs as expected, so it is not the vesion of VS that is the problem, I just don't know what other configuration options could cause this to fail in this way. 编辑:我创建了一个新的解决方案,只包含一个单元测试(对于true==false )这按预期运行,所以它不是VS的存在就是问题,我只是不知道其他配置选项可以导致这种方式失败。

Found that there were some configuration files in the solution directory that were causing problems. 发现解决方案目录中存在一些导致问题的配置文件。 deleting them fixed the issue. 删除它们修复了问题。

I got into same issue when upgrading solution from VS 2010 to 2012. All tests disapeared. 当我将解决方案从VS 2010升级到2012时,我遇到了同样的问题。所有测试都没有消失。 I got over this by deleting the old (VS2010) solution file. 我通过删除旧的(VS2010)解决方案文件来解决这个问题。 Then, I created new one using VS2012 and added all the projects to the new solution. 然后,我使用VS2012创建了新的项目,并将所有项目添加到新解决方案中。 After Rebuild all tests appeared in tests explorer. 重建后,所有测试都出现在测试资源管理器中。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM