Cannot debug a unit testing project in Visual Studio 2012

天大地大妈咪最大 提交于 2019-11-29 05:49:44

You'll want to debug it a different way:

Ensure that you used the "unit test project" template when creating the visual studio project which contains your test. Visual studio needs some metadata in the csproj markup to now how to execute a class library.

You can add it or confirm it is present by editing the csproj file in notepad:

<Project>
 <PropertyGroup>
  <ProjectTypeGuids>{3AC096D0-A1C2-E12C-1390-A8335801FDAB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
 </PropertyGroup>
</Project>

Details @ http://onlinecoder.blogspot.ca/2009/09/visual-studio-projects-project-type.html

Now it should work with F5 in Visual Studio. If it still doesn't work, right click on the test and click 'run tests' or use the test explorer (Test > Windows > Test Explorer)

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