开发者

Can't debug code when VS 2010 debugger started with external program

This is r开发者_JS百科eally 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.


In VS2010 are you targeting a lower version framework? If so try changing the targeted framework to 4.0 in your advanced compile options.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜