Tools - KirillOsenkov/Bliki GitHub Wiki

A .NET Developer's Problem-Solving Toolbelt

I find that a lot of problems in the .NET world can be investigated and solved using a quite limited but complementary set of tools. Knowing what tools to apply in which situation will make you a great problem solver and a go-to person on your team.

Debugging

Starting a new .exe under debugger

When you need to attach a debugger to the very beginning of a process execution, you can open the .exe file in Visual Studio using File -> Open Project. It will open the .exe as a "project", and in that project's properties you can configure the command line arguments, working directory, etc.

image

Automatically collecting .dmp dumps for crashing processes

Run this .reg file:

Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\Windows Error Reporting\LocalDumps]
"DumpFolder"="C:\CrashDumps"
"DumpCount"=dword:00000010
"DumpType"=dword:00000002

It will ensure that for every crashing application on your system an automatic full dump is saved in the C:\CrashDumps folder. It will preserve 16 (0x10) latest dumps. DumpType 0x2 means full dump. More info: https://msdn.microsoft.com/en-us/library/windows/desktop/bb787181(v=vs.85).aspx

Automatically attach to child processes started by the debuggee

Use this Visual Studio extension: https://marketplace.visualstudio.com/items?itemName=GreggMiskelly.MicrosoftChildProcessDebuggingPowerTool If you enable it and debug using mixed mode (Managed + Native), it will automatically attach to all child processes started by the parent debuggee process.

Visual Studio supports attaching to more than one process at a time. You can switch the "active" process in the Debug -> Windows -> Processes tool window.

Pdbs and Symbols

Pdb.exe https://github.com/KirillOsenkov/MetadataTools/tree/master/Pdb https://github.com/KirillOsenkov/MetadataTools/releases/download/v1.0.2/Pdb.zip

Investigating build issues

https://github.com/Microsoft/MSBuild/wiki http://msbuildlog.com

Investigating assembly versions, assembly loading and runtime resolution

ListBinaryInfo (lbi.exe)

https://github.com/KirillOsenkov/CodeCleanupTools/blob/main/README.md#lbi-listbinaryinfo

Like dir /s, but for assemblies. Groups assemblies by version, displays assembly names.

Usage: ListBinaryInfo.exe [<pattern>] [/nr]
        /nr: non-recursive (current directory only). Recursive by default.

  Examples:
    ListBinaryInfo foo.dll
    ListBinaryInfo *.exe /nr
    ListBinaryInfo

https://github.com/KirillOsenkov/CodeCleanupTools/tree/master/ListBinaryInfo https://github.com/KirillOsenkov/CodeCleanupTools/releases/download/listbinaryinfo.1.0.4/ListBinaryInfo.exe

⚠️ **GitHub.com Fallback** ⚠️