当VS 2010调试器使用外部程序启动时,无法调试代码 [英] Can't debug code when VS 2010 debugger started with external program

查看:812
本文介绍了当VS 2010调试器使用外部程序启动时,无法调试代码的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这真的很奇怪,我似乎无法弄清楚为什么它不起作用。



我有一个C#dll是另一个添加程序,主程序不是我的或一个.Net应用程序,所以我启动它与启动外部程序在调试选项卡,并传递我的程序作为一个命令行,程序启动并加载我的添加,但我的Visual Studio调试器不我进入调试器,不会打破我的断点。



我检查了模块窗口,甚至没有加载到那里,我使用过程浏览器,并有一个看看主程序,我的DLL被加载到主应用程序。



该项目设置为调试,符号已满,仍然没有。



我在VS 2008中创建了该项目,并且工作正常,现在正在尝试使其在VS 2010中工作,而不会执行。



任何人知道可能导致这种情况?

解决方案

我找到了解决方案,将以下内容复制到xml文件名为 {ProgramToBeAttached} .exe.config

  ?xml version =1.0?> 
< configuration>
< startup>
< supportedRuntime version =v2.0.50727/>
< / startup>
< / configuration>

Visual Studio 2010在调试器中加载程序时查看此文件,以获取正确的.NET运行时版本。


This is really strange and I can't seem to figure out why it won't work.

I have a C# dll that is a add on for another program, the main program is not mine or a .Net app so I am starting it with Start external program in the debugging tab and and passing my program as a command line and the program starts and loads my add on however my Visual Studio debugger doesn't step into the debugger and won't hit my break points.

I checked the module window and it's not even loaded in there, I used process explorer and had a look at main program and my dll was loaded into the main app.

The project is set to debug, symbols to full and still nothing.

I created the project in VS 2008 and it worked fine and am now trying to get this to work in VS 2010 and no go.

Anyone know what could be causing this?

解决方案

I found the solution, copy the following into a xml file named {ProgramToBeAttached}.exe.config:

<?xml version="1.0"?>
<configuration>
  <startup>
    <supportedRuntime version="v2.0.50727"/>
  </startup>
</configuration>

Visual Studio 2010 looks at this file when it loads the program in the debugger to get the right .NET runtime version.

这篇关于当VS 2010调试器使用外部程序启动时,无法调试代码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆