Can I set a breakpoint in the source code of a managed application when I use WinDbg?

I tried to set a breakpoint using WinDbg in the source code of a C # application, but it did not work. Is there a way to set a breakpoint in the source code of a managed application when I use WinDbg?

Repro step:

1. Make a simple C # application

class Proram
{
  static void MyWrite(){
      Console.WriteLine("test");
  }
  static void Main(string[] args){
      Console.ReadLine();
      MyWrite();
  }
 }

2. Run the .NET application from WinDbg
3. Open the source file in WinDbg
Run 4.Break (while the application in ReadLine ())
5. Create a symbol path and load sos.dll
6. Set a breakpoint on Console.WriteLine ( "test") using F9
7. Run the command "g"
8.Error occurred

Unable to insert breakpoint 0 at <address>, Win32 error 0x998 
     "Invalid access to memory location."
bp0 at <address> failed
WaitForEvent failed

, , , .

+5
2

! sosex.mbp. , myapp.cs, 10: ! mbp myapp.cs 10

sosex http://www.stevestechspot.com

+1

Try:

0:000> sxe ld clrjit.dll

ModLoad: 72ea0000 72f1d000   C:\Windows\Microsoft.NET\Framework\v4.0.30319\clrjit.dll

0:000> .loadby sos clr

0:000> !bpmd SslStreamTest.exe SslStreamTest.Program.Main

Found 1 methods in module 00bb2edc
+1

All Articles