代码之家  ›  专栏  ›  技术社区  ›  Brian Mains

VS2010、NUNit和“断点当前不会被击中。没有为此文档加载任何符号“

  •  29
  • Brian Mains  · 技术社区  · 14 年前

    使用Windows7 32位,VS2010,.NET4DLL,NUnit(2.5.5)对应用程序进行单元测试。我目前得到以下错误;看到很多帖子,尝试了以下方法:

    1. 重新启动VS
    2. 删除bin/obj并重新加载
    3. 清理/重建

    但我不能让NUnit在运行时命中断点;

    我将NUNit测试项目设置为指向NUNit.exe,并加载测试.NET4DLL,但运行时没有找到断点,“没有加载任何符号”。我试过调试>windows>模块,它甚至没有显示我的单元测试项目,当我运行它。

    我发现了这个,使用nunit代理: http://groups.google.com/group/nunit-discuss/browse_thread/thread/5680d7def5b6982f

    有人能帮忙吗?

    9 回复  |  直到 14 年前
        1
  •  43
  •   Community CDub    7 年前

    here on Stack Overflow ,我贴的地方 my answer

    我将nunit.exe设置为项目中的外部程序->属性->调试并添加:

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

        2
  •  16
  •   Nightfirecat peSHIr    13 年前

    解决方案是:启动NUnit单机版,然后在VS2010中,执行调试>附加到进程,并附加到nunit-agent.exe进程,而不是nunit进程。努尼特进程仍然没有帮我。

        3
  •  1
  •   JimBayne    14 年前

    我得到的是“突破点不会被击中。。。没有符号加载…“的网站项目。发现我的网站中存在生成错误(由于某种原因,其中一个引用的dll丢失)。在我选择“查看”=>之前,“重建”不会显示问题;VS2010中的错误列表,在重建之前。替换bin目录中缺少的dll;更新参考资料解决了我的问题。

        4
  •  1
  •   Daniel    14 年前

    在nunit-x86.exe.config中添加以下部分对我很有用:

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

        5
  •  1
  •   user2195750    12 年前

        6
  •  0
  •   Mau    14 年前

    你在运行NUnit然后加载DLL吗? 尝试打开“项目属性”、“调试”选项卡,将“开始”操作切换到“启动外部程序”,指向NUnit exe,将dll名称放在“命令行参数”中。 然后启动库项目右键单击它并选择“调试”->启动新实例。

        7
  •  0
  •   Manasvi Sareen    11 年前

    附加nunit-agent.exe进程而不是nunit.exe,因为当dotnet版本与nunit-it-self使用的版本不同时,nunit将通过nunit-agent执行任务。请参见下面的链接。

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

        8
  •  0
  •   Alexei - check Codidact    9 年前

    <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>
    
        9
  •  0
  •   patrick    8 年前

    我需要打开NUnit GUI

    工具->设置->IDE支持[单击Visual Studio]

    然后在 nunit-x86.exe.config文件 ,

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

    <configuration>