When you launch .Net executable with WinDBG, in order to “catch” something nasty like AccessViolationExcetion, the application will stop after loading with a “debugger break”, and you will see something like this:
1 2 3
(6b8.37dc): Break instruction exception - code 80000003 (first chance) ntdll!LdrpDoDebuggerBreak+0x30: 00007ffc`391d121c cc int 3
At this point, if you try to load SOS, you will see an error.
1 2
0:000> .loadby sos coreclr Unable to find module 'coreclr'
This happens because CLR is not loaded yet; the following command will make sure that WinDBG will stop as soon as .Net is loaded.