[英]Breakpoint cannot be hit in c# project for anything other than .NET 3.5
I have just upgraded a solution previously running in VS2008 on .NET 3.5
to VS2015 running on .NET 4.6
. 我刚刚将以前在
.NET 3.5
上的VS2008中运行的解决方案升级到在.NET 4.6
上运行的VS2015。
Some information about the project 有关该项目的一些信息
Unit Test Project
and simply creates 'AVTest.dll` which we load into NUnit to perform some functional tests on some hardware. Unit Test Project
,只是创建'AVTest.dll`,我们加载到NUnit中 ,在某些硬件上执行一些功能测试。 Everything builds and runs correctly however i get the following error when trying to set breakpoints: 所有东西都构建并正确运行但是在尝试设置断点时出现以下错误:
The breakpoint will not currently be hit.
断点当前不会被击中。 No symbols have been loaded for this document.
没有为此文档加载任何符号。
When i switch back to .NET 3.5 i am able to set breakpoints in the code. 当我切换回.NET 3.5时,我能够在代码中设置断点。 The fact that i can do this makes me think i am missing somerthing simple about the .NET version since i am not so familiar with
c#
. 我可以这样做的事实让我觉得我缺少关于.NET版本的简单,因为我对
c#
不太熟悉。
I am aware of this question and have tried all of the things from the question itself and the first page of answers. 我知道这个问题,并尝试了问题本身和答案第一页的所有内容。
Has there been any developments on how to check why there have been no loaded symbols? 关于如何检查没有加载符号的原因是否有任何进展?
I am able to debug just fine when i attach to the Nunit test that is already running. 当我附加到已经运行的Nunit测试时,我能够正常调试。 I am not sure why it isnt attached after running (through start external program) or why this works in 3.5 and not 4.6, but it can be debugged ...
我不确定它为什么在运行后(通过启动外部程序)或者为什么在3.5而不是4.6中工作,但它可以被调试...
This turned out to be a simple problem with NUnit rather than Visual studio. 这对NUnit而不是Visual studio来说是一个简单的问题。 Essentially you need to add this to your NUnit configuration file before the
<runtime\\>
section: 基本上,您需要在
<runtime\\>
部分之前将其添加到NUnit配置文件中:
<startup useLegacyV2RuntimeActivationPolicy="true">
<supportedRuntime version="v4.0"/>
</startup>
This file is usually located here: 此文件通常位于此处:
C:\\Program Files (x86)\\NUnit 2.5.10\\bin\\net-2.0\\nunit-x86.exe.config
C:\\ Program Files(x86)\\ NUnit 2.5.10 \\ bin \\ net-2.0 \\ nunit-x86.exe.config
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.