简体   繁体   English

VS 2010,NUNit和“断点目前不会被击中。 没有为此文档加载任何符号“

[英]VS 2010, NUNit, and “The breakpoint will not currently be hit. No symbols have been loaded for this document”

Using Windows 7 32 bit, VS 2010, .NET 4 DLL, NUnit (2.5.5) to unit test the application. 使用Windows 7 32位,VS 2010,.NET 4 DLL,NUnit(2.5.5)对应用程序进行单元测试。 I'm currently getting the following error; 我目前收到以下错误; seen plenty of posts and tried the following: 看到很多帖子并尝试了以下内容:

  1. restart machine 重启机器
  2. restart VS 重启VS.
  3. delete bin/obj and reload 删除bin / obj并重新加载
  4. clean/rebuild 清洁/重建

But I cannot get NUnit to hit my breakpoints when running; 但是我跑步时无法让NUnit达到我的断点。

I set the NUNit test project to point to the nunit.exe, and to load the testing .NET 4 DLL, but when I run it doesn't find the breakpoint, "no symbols have been loaded". 我将NUNit测试项目设置为指向nunit.exe,并加载测试.NET 4 DLL,但是当我运行它时没有找到断点,“没有加载符号”。 I tried debug >windows > modules, it doesn't even show my unit testing project when I run it. 我尝试了debug> windows> modules,当我运行它时,它甚至没有显示我的单元测试项目。

I found this, to use the nunit agent: http://groups.google.com/group/nunit-discuss/browse_thread/thread/5680d7def5b6982f 我找到了这个,使用nunit代理: http ://groups.google.com/group/nunit-discuss/browse_thread/thread/5680d7def5b6982f

But I get an error when I use the nunit agent too. 但是当我使用nunit代理时,我也会收到错误。 I was using nunit-agent-x86.exe, but I get a system.formatexception and it crashes... 我使用的是nunit-agent-x86.exe,但是我收到了一个system.formatexception,它崩溃了......

Can anybody help? 有人可以帮忙吗?

Thanks. 谢谢。

There's another similar question here on Stack Overflow , where I posted my answer with what worked for me. Stack Overflow上还有另一个类似的问题,我在那里发布了对我有用的答案 I can set breakpoints and start NUnit directly from Visual Studio 2010 with Debug -> Start New Instance (which I think is your goal). 我可以使用Debug - > Start New Instance(我认为这是你的目标)直接从Visual Studio 2010设置断点并启动NUnit。

I set nunit.exe as the external program in project -> Properties -> Debugging and added: 我将nunit.exe设置为项目中的外部程序 - >属性 - >调试并添加:

<startup>
    <requiredRuntime version="4.0.30319" />
</startup>

to the nunit.exe.config file found next to the nunit executable in the NUnit install directory. 到NUnit安装目录中nunit可执行文件旁边的nunit.exe.config文件。

The resolution was: start NUnit stand alone, then in VS 2010, do debug > attach to process, and attach to the nunit-agent.exe process, not the nunit process. 决议是:单独启动NUnit,然后在VS 2010中,执行debug> attach to process,并附加到nunit-agent.exe进程,而不是nunit进程。 Nunit process still didn't do it for me. Nunit进程仍然没有为我做。

如果上述所有操作都没有帮助,请在Visual Studio中打开NUnit项目的属性,打开“Build”选项卡,单击“Advanced”按钮并确保“Debug Info”设置为“full”

I was getting "break point will not be hit ... no symbols loaded ..." for a website project. 对于一个网站项目,我得到“断点不会被击中......没有符号加载......”。 Found that there were build errors in my website (one of the referenced dll's went missing for some reason). 发现我的网站中存在构建错误(其中一个引用的dll由于某种原因而丢失)。 Rebuilds didn't show the problem until I selected View=>Error list in VS2010, prior to the rebuild. 在重建之前,我在VS2010中选择了View => Error list之前,重建没有显示问题。 Replacing the missing dll in the bin dir & updating the reference solved my problem. 替换bin目录中缺少的dll并更新引用解决了我的问题。

Adding the following section in the nunit-x86.exe.config worked for me: 在nunit-x86.exe.config中添加以下部分对我有用:

  <startup>
      <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0,Profile=Client"/>
  </startup>

The 'sku' section is only needed when running with .NET 4's Client Profile. 只有在运行.NET 4的客户端配置文件时才需要'sku'部分。 Note that a previous answer showed using 'requiredRuntime' which is obsolete. 请注意,之前的答案显示使用的'requiredRuntime'已过时。

Attach nunit-agent.exe process instead of nunit.exe because when dotnet version is different form what is used by nunit it self, nunit execute the task by nunit agent. 附加nunit-agent.exe进程而不是nunit.exe,因为当dotnet版本与nunit it self使用的不同时,nunit会执行nunit代理的任务。 See the link below. 请参阅以下链接。

http://www.nunit.org/index.php?p=nunit-agent&r=2.5.10 http://www.nunit.org/index.php?p=nunit-agent&r=2.5.10

Are you running NUnit and then loading the DLL? 你在运行NUnit然后加载DLL吗? Try instead opening the project properties, Debug tab, switch the start action to 'Start external program', point to the NUnit exe, put your dll name in 'command line arguments'. 尝试打开项目属性,调试选项卡,将启动操作切换到'启动外部程序',指向NUnit exe,将您的dll名称放在'命令行参数'中。 Then start the library project right-clicking it and choosing Debug -> start new instance. 然后启动库项目右键单击它并选择Debug - > start new instance。

This problem occurred to me under Visual Studio 2012 Community Edition, when working with .NET Framework 4.5. 使用.NET Framework 4.5时,在Visual Studio 2012 Community Edition下发生此问题。 nunit.exe.config should like this (solution from the most appreciated answer): nunit.exe.config应该是这样的(解决方案来自最受欢迎的答案):

<configuration>
    <!--
   The GUI only runs under .NET 2.0 or higher. The
   useLegacyV2RuntimeActivationPolicy setting only
   applies under .NET 4.0 and permits use of mixed 
   mode assemblies, which would otherwise not load 
   correctly.
  -->
    <startup useLegacyV2RuntimeActivationPolicy="true">
        <!-- Comment out the next line to force use of .NET 4.0 -->
         <requiredRuntime version="4.0.30319" />
    </startup>

I needed to open the NUnit GUI 我需要打开NUnit GUI

Tools->Settings->IDE Support [click Visual Studio] 工具 - >设置 - > IDE支持[单击Visual Studio]

Then in the nunit-x86.exe.config (NOT nunit-exe.config, NOT nunit.agent.exe.config, NOT nunit-console.exe.config) , 然后在nunit-x86.exe.config (NOT nunit-exe.config,NOT nunit.agent.exe.config,NOT nunit-console.exe.config)中

I needed 我需要

   <startup useLegacyV2RuntimeActivationPolicy="true">
    <supportedRuntime version="v4.0.30319" />
  </startup>

under <configuration> <configuration>

暂无
暂无

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

相关问题 VS 2010远程调试器断点当前不会被命中。 没有为此文档加载任何符号 - VS 2010 remote debugger breakpoint will not currently be hit. No symbols have been loaded for this document 当前不会命中断点。 未在 Unity 中为该文档加载任何符号 - The breakpoint will not currently be hit. No symbols have been loaded for this document in Unity VS-2012 :当前不会命中断点。 尚未为该文档加载任何符号 - VS-2012 : Breakpoint will not currently be hit. No symbols have been loaded for this document VS2015 目前不会命中断点。 没有为此文档加载任何符号 - VS2015 The breakpoint will not currently be hit. No symbols have been loaded for this document VS 2013断点目前不会被击中。 没有为此文档加载任何符号 - VS 2013 the breakpoint will not currently be hit. no symbols have been loaded for this document 附加调试器 - 当前不会触发断点。 没有为此文档加载任何符号 - Attach Debugger - The breakpoint will not be currently hit. No symbols have been loaded for this document 断点当前不会被击中。在Silverlight应用程序中没有为此文档加载任何符号 - The breakpoint will not currently be hit. No symbols have been loaded for this document in a Silverlight application 断点当前不会被命中。 没有为该文档加载任何符号。 删除dll时 - The breakpoint will not currently be hit. No symbols have been loaded for this document. when debussing dll 此断点当前不会被命中。 在项目 asp.net web forms 中没有为此文档加载任何符号 - this breakpoint will not currently be hit. no symbols have been loaded for this document in project asp.net web forms 如何补救“当前不会命中断点。没有为该文档加载任何符号。” 警告? - How do I remedy "The breakpoint will not currently be hit. No symbols have been loaded for this document." warning?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM