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
, , , .