views:

222

answers:

2

I am working on a C#.NET class library project in VS2010. In my project settings -> debug settings, I have the project set to start an external program (C:\Windows\SysWOW64\wscript.exe) which runs a very simple jscript file (test.js). The script simply creates an instance of the class and calls one of it's methods.

The problem is when I start debugging, VS2010 does not stop at any of my breakpoints. If I open up the exact same project in VS2008 it does stop at the break points. Is there a new setting somewhere that is preventing the breakpoints from being hit? Has anyone else ran into this issue?

A: 

My first check would be to disable "Just My Code"

  • Tools -> Options
  • Debugger
  • Uncheck "Enable Just My Code"

Try the scenario again.

JaredPar
Tried that, no help.
Jordan S
A: 

While I can't answer why it happens, I can provide you with workaround.

1 - Include

using System.Diagnostics;

2 - At the very beginning of your code (Class constructor for instance) place the following lines:

#if (DEBUG)
                    while(!Debugger.IsAttached);
                    Debugger.Break();
#endif

3 - Start debugging. 4 - Menu Tools->Attach to Process 5 - Attach to your process.

breakpoint should trigger in your code. Other breakpoints should trigger as well.

Hope this helps. Regards, David.

David Goshadze