About this article: This article is reviewed against the cited sources. This is source research, not lab validation. Check the stated versions and your own requirements before making changes.
When a .NET service or application disappears and the Application log holds Event ID 1026 from the source .NET Runtime, the process ended because an exception reached the top of a thread and nothing caught it. The event text says Description: The process was terminated due to an unhandled exception. and the lines after Exception Info: name the exception. Read those lines first. If they do not explain the crash, set up Windows Error Reporting to save a dump at the next one.
What the event means
In the dotnet/runtime source at tag v8.0.11, the code that writes this event (src/coreclr/vm/eventreporter.cpp) sets the event ID to 1026 for an unhandled exception and names the source .NET Runtime. The text is built from resource strings in mscorrc.rc: it begins with Application: and the process name, then CoreCLR Version: and .NET Version: , then Description: The process was terminated due to an unhandled exception., then Exception Info: and a Stack: section.
The same code uses other IDs for other endings: 1025 for System.Environment.FailFast, 1023 for an internal runtime error, 1027 for a stack overflow and 1028 for a failed code contract. So 1026 is specifically an exception that nobody handled.
Two limits follow from the source. The code does not write the event when a debugger is attached. And the source read covers .NET (CoreCLR) at v8.0.11 only; the event for .NET Framework applications is worded differently or not at all in that source.
Microsoft's page on handling exceptions states the principle behind the event: "if an exception is thrown and you don't handle it, the runtime terminates your application." Event 1026 is the record that it happened, not the reason.
Likely causes
The event cannot name the cause. The exception type in Exception Info: is the lead. The mapping below is our own reading of common exception types.
| Cause | What you see | How to confirm |
|---|---|---|
| A bug on a worker or background thread | A type such as NullReferenceException or InvalidOperationException, with your own namespaces in Stack: |
The top frames are your code; the crash repeats under the same action |
| A missing or wrong dependency at start | FileNotFoundException or TypeInitializationException within seconds of start |
The event time matches a start or a deployment |
| A resource limit | OutOfMemoryException, or a database or network exception after a long run |
Memory or connection counts rose before the crash; see .NET Process Memory Keeps Rising: Prove Retention Before Calling It a Leak |
| A configuration change | An exception that reads a setting, such as FormatException or ArgumentException |
A settings file changed shortly before the first event |
| A native component crash | No managed exception text; a different event ID or source | Our own reading: a fault in native code is not recorded as 1026, so look for a different event ID or source |
Prove the cause before changing anything
All of these read only.
1. List the events. Run this in PowerShell on the server, as an administrator if the log needs it:
Get-WinEvent -FilterHashtable @{ LogName='Application'; ProviderName='.NET Runtime'; Id=1026 } -MaxEvents 20 | Format-List TimeCreated, Message
Microsoft's Get-WinEvent page shows FilterHashtable with the keys LogName, ProviderName, Id and StartTime, and -MaxEvents limits the count. A good result is a short list whose Message shows the lines described above. A bad result is no events: the crash was logged under another ID or source, or the log was cleared.
2. Read the Exception Info: block. Note the exception type, its message and the first frames of Stack:. A stack ending in your own assembly points to your code; a stack inside framework namespaces points to what your code called.
3. Line up the times. Compare each event's TimeCreated with deployments, restarts and scheduled jobs. Several events at the same clock time point to a job; events minutes after each start point to start-up work.
4. Check whether dumps are already saved. Microsoft's "Collecting User-Mode Dumps" page says user-mode dump collection "is not enabled by default", so without a local dump, the event text is all you have. If a dump exists in the configured DumpFolder, read it with dotnet-dump analyze, covered under "Confirm the fix".
Fix
The durable fix is a change to the code or configuration that the exception names, and that change belongs to whoever owns the application. If the event text alone does not show where the exception starts, a dump taken at the next crash can. Windows can be set up to save one, as follows.
Microsoft's page "Collecting User-Mode Dumps" says Windows Error Reporting can save a dump after a user-mode application crashes, under the registry key HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\Windows Error Reporting\LocalDumps, and that a key named for the executable under it holds per-application settings. Its values include DumpFolder (default %LOCALAPPDATA%\CrashDumps), DumpCount (default 10; the oldest file is replaced) and DumpType (0 custom, 1 mini, 2 full; default 1). The page says that for service crashes the dump goes to service-specific profile folders unless you set a folder, and that a custom folder must allow the crashing process to write to it. The same page says that a dump is not collected when automatic debugging for application crashes is set.
The .NET page "Collect dumps on crash" lists DOTNET_DbgEnableMiniDump for the same purpose; this section uses Windows Error Reporting instead. Our own reading: a process ended by an unhandled .NET exception counts as the crash that Windows Error Reporting acts on.
First save the current state:
reg export "HKLM\SOFTWARE\Microsoft\Windows\Windows Error Reporting\LocalDumps\OrdersWorker.exe" localdumps-before.reg
This saves the per-application key. Our own reading: if the key does not exist, reg export fails, which tells you there is nothing to save. The reg export page lists only the return values 0 for "Success" and 1 for "Failure", so a failure can also have another cause, such as no permission. Read the error text. If it does not say the key was not found, stop here and do not carry on until the cause of the failure is fixed.
Risk: the next three commands add a per-application crash-dump setting for OrdersWorker.exe. Microsoft's .NET "Dumps" page says a dump "might contain sensitive information" and can hold "the full memory of the running process". Our own reading: a full dump (DumpType 2) can be as large as the process. DumpCount 5 keeps up to five of them, and the folder must have the disk space for all five. Microsoft's WER page says the system checks the registry settings when an application crashes, so the change takes effect at the next crash without a restart of the application. The setting also needs the folder D:\CrashDumps to exist already, with permissions that let the account running the service write to it; the commands below do not create it.
With that folder in place, run:
reg add "HKLM\SOFTWARE\Microsoft\Windows\Windows Error Reporting\LocalDumps\OrdersWorker.exe" /v DumpFolder /t REG_EXPAND_SZ /d D:\CrashDumps /f
reg add "HKLM\SOFTWARE\Microsoft\Windows\Windows Error Reporting\LocalDumps\OrdersWorker.exe" /v DumpCount /t REG_DWORD /d 5 /f
reg add "HKLM\SOFTWARE\Microsoft\Windows\Windows Error Reporting\LocalDumps\OrdersWorker.exe" /v DumpType /t REG_DWORD /d 2 /f
Only if you need to back out, run only the block that applies below. Each block says first what it removes.
Risk: the next two commands remove the per-application key for OrdersWorker.exe and then write back the values saved in localdumps-before.reg. Run them only if the export above succeeded, which means the key existed before.
reg delete "HKLM\SOFTWARE\Microsoft\Windows\Windows Error Reporting\LocalDumps\OrdersWorker.exe" /f
reg import localdumps-before.reg
Risk: the next command removes the per-application key for OrdersWorker.exe and nothing is written back. Run it only if the export failed with an error text saying the key was not found, which means the key was new. If the export failed for any other reason, do not run it, because the key may hold values that were never saved.
reg delete "HKLM\SOFTWARE\Microsoft\Windows\Windows Error Reporting\LocalDumps\OrdersWorker.exe" /f
After the second block only, to check that the key is gone, export it to a different file name. Our own reading: the export fails when the key does not exist. After the first block the key is back, so the export succeeds and says nothing about "gone".
reg export "HKLM\SOFTWARE\Microsoft\Windows\Windows Error Reporting\LocalDumps\OrdersWorker.exe" localdumps-check.reg
Example (illustrative): On app01, the service OrdersWorker.exe stops at 02:14 each night. Get-WinEvent lists Event ID 1026 at 02:14 on four nights, each with Exception Info: System.InvalidOperationException and the same top frame in the nightly import class. Memory use is normal. With D:\CrashDumps already in place, the administrator adds the three values above and waits. The next crash leaves one dump. With a working set of about 3.5 GB, five full dumps need up to 5 x 3.5 GB = 17.5 GB, which the administrator checks is free on D: before starting.
Confirm the fix
- Our own reading: a crash after the change leaves a file in the
DumpFolderyou set. - Where
dotnet-dumpis already installed,dotnet-dump analyze <dump_path>reads the file without changing it. Microsoft's page showsclrstackfor a stack andpe -lines"To see an unhandled exception that killed your app". The same page offers the tool as a global tool (dotnet tool install --global dotnet-dump) or a direct download; installing it is a change to the server and not covered here. - After the code or configuration fix, Event ID 1026 stops for the same exception at the same time.
What to watch afterwards
- The size of the
DumpFolder; withDumpCountas set, the folder cannot hold more than that many files, but each full dump can be large. - New Event ID 1026 entries with a different exception type: a fixed bug can expose a second one.
- Dumps contain process memory. Microsoft's .NET "Dumps" page says they "might contain sensitive information", so the permissions on the
DumpFolderare a security matter.
Read next
Related articles you may want next.
- Troubleshooting.NET "You must install or update .NET to run this application": read the Framework line, then match the runtimeYou must install or update .NET to run this application: read the Framework and .NET location lines, list runtimes, then fix the mismatch.Read article
- Performance.NET Process Memory Keeps Rising: Prove Retention Before Calling It a LeakSeparate managed heap retention, allocation churn and native memory, then identify a bounded evidence capture.Read article
- Performance.NET Requests Stall with Low CPU: Diagnose Thread Pool StarvationDetermine whether worker starvation and blocking call stacks explain the incident before tuning worker limits.Read article
Risks and limits
- These commands have not been run or lab-tested.
- The registry changes affect only the named executable, but a full dump can fill a disk quickly.
- The event layout is a reading of the v8.0.11 source. Other .NET releases may word it differently, and .NET Framework applications are not covered by that source.
- The table of causes is our own reading of common exception types.
Sources
- Collecting User-Mode Dumps — Microsoft Learn, 18 July 2024, accessed 3 December 2026
- Collect dumps on crash — Microsoft Learn, 20 January 2026, accessed 3 December 2026
- Dumps — Microsoft Learn, 23 February 2026, accessed 3 December 2026
- Dump collection and analysis utility (dotnet-dump) — Microsoft Learn, 4 March 2026, accessed 3 December 2026
- Handling and throwing exceptions in .NET — Microsoft Learn, 15 September 2021, accessed 3 December 2026
- Get-WinEvent — Microsoft Learn, no date shown, accessed 3 December 2026
- reg add — Microsoft Learn, 4 January 2024, accessed 3 December 2026
- reg export — Microsoft Learn, 3 February 2023, accessed 3 December 2026
- reg delete — Microsoft Learn, 3 February 2023, accessed 3 December 2026
- reg import — Microsoft Learn, 3 February 2023, accessed 3 December 2026
- eventreporter.cpp — dotnet/runtime source, tag v8.0.11, no date shown, accessed 3 December 2026
- mscorrc.rc — dotnet/runtime source, tag v8.0.11, no date shown, accessed 3 December 2026
This article was originally published on .