.NET Core and WinDbg support

  •   Posted in:
  • .NET

When I am working with WinDbg and .NET I usually using following command to load .NET support Dll into WinDbg:
.cordll -ve -u -l

But in case of .NET Core it does not work. It took me quite some time to figure out what to do. Firstly, install dotnet-sos tool into dotnet:
dotnet tool install -g dotnet-sos

Then activate dotnet-sos tool by execution this command:
dotnet-sos install

And this will copy support dll to C:\Users\<username>\.dotnet\sos\sos.dll, where <username> is your username on this computer. These two commands you need to execute only once per .NET Core version or after tool is updated.

And lastly to load this dll into WinDbg, execute this command in WinDbg:
.load C:\Users\<username>\.dotnet\sos\sos.dll

And then all SOS commands will be available to you as usual.

Update from May 11, 2021:

If you need x86 version used this command:

dotnet-sos install --architecture X86

Update from December 18, 2023:

You may need to execute following command:

dotnet tool uninstall -g dotnet-sos

and then repeat everything from the top. In my case by some reason I stuck on version 3.1 even I have .NET 8 installed.