Skip to content

Creating a Dump File When dotnet-dump Fails

The dotnet-dump tool is a great help to create dump files. But even with an administrator account you can sometimes run into this error:

dotnet-dump -p 10376

Writing full to c:\temp\dump_*.dmp
Invalid process id 10376 - Access is denied. (5)

Should this happen on your machine, you may want to use ProcDump from Sysinternals to overcome this obstacle.

Download and extract the zip file, go to the directory you want to store the dump file and run this command to create a full dump of process 10376 (the process id is the same as we got with dotnet-dump ps):

C:\path\to\procdump.exe -ma 10376

So far, ProcDump worked for me on all the machines dotnet-dump failed.

Make sure that you read the documentation at least once. ProcDump offers many helpful options that can create dumps at specific triggers or only dump parts of the memory.

If you need to transfer the dump file over a slow connection, you best zip the dump file before you transfer it to another computer. This will massively reduce the file size and will take much less time to transfer it.

Next

Now that everyone should be able to create a dump file, we can continue the hunt for the memory leak and explore JetBrains dotMemory tool.