I'm trying to create crash dump files for a crashing IIS/.NET process on Windows Server 2012 R2.
I've written the following PowerShell script as part of code deployment which works correctly for local development, but with the same Registry keys set on the application server, dump files are not created. I've checked the permissions for SYSTEM
on the registry and the collection folder and they seem to be correct, so I'm not quite sure why the dump files aren't being generated.
Running a test application on the server that does nothing but crash via a stack overflow just generates an application pop-up, but no dump files.
I tried all of the possible solutions given here, and none of them have resolved the problem.
$dumpFolder = "C:\crash-dumps"
if (!(Test-Path $dumpFolder)) {
mkdir $dumpFolder | Out-Null
}
$dumpKey = "HKLM:SOFTWARE\Microsoft\Windows\Windows Error Reporting\LocalDumps"
if (!(Test-Path $dumpKey)) {
New-Item -Path $dumpKey | Out-Null
}
$dumpKey = "HKLM:SOFTWARE\Microsoft\Windows\Windows Error Reporting\LocalDumps\dotnet.exe"
New-Item -Path $dumpKey -Force | Out-Null
New-ItemProperty -Path $dumpKey -Name DumpFolder -Value $dumpFolder -PropertyType String -Force | Out-Null
New-ItemProperty -Path $dumpKey -Name DumpCount -Value 3 -PropertyType DWORD -Force | Out-Null
New-ItemProperty -Path $dumpKey -Name DumpType -Value 2 -PropertyType DWORD -Force | Out-Null
$dumpKey = "HKLM:SOFTWARE\Microsoft\Windows\Windows Error Reporting\LocalDumps\w3wp.exe"
New-Item -Path $dumpKey -Force | Out-Null
New-ItemProperty -Path $dumpKey -Name DumpFolder -Value $dumpFolder -PropertyType String -Force | Out-Null
New-ItemProperty -Path $dumpKey -Name DumpCount -Value 3 -PropertyType DWORD -Force | Out-Null
New-ItemProperty -Path $dumpKey -Name DumpType -Value 2 -PropertyType DWORD -Force | Out-Null