Hi,
You're experiencing a critical crash (APPCRASH
) of the w3wp.exe
process when uploading and processing an Excel file using OleDb
in your ASP.NET Web Forms application deployed on Windows Server 2022 with IIS, which results in your application pool stopping.
Based on the exception code and crash logs, here's a breakdown and a step-by-step guide to diagnose and resolve the issue:
Root Cause Analysis Summary
The crash involves:
-
w3wp.exe
(IIS worker process)
-
KERNELBASE.dll
(common cause of .NET interop or COM component failure)
- Exception code:
0xe06d7363
→ C++ exception, usually caused by unmanaged code (like OLE DB providers)
This strongly suggests a problem with:
OleDbConnection using Jet OLEDB / ACE OLEDB to access Excel files on a production server — likely due to:
- Missing or incorrect version of Microsoft Access Database Engine
- 32-bit vs 64-bit compatibility mismatch
- Permissions or sandboxing restrictions in ApplicationPoolIdentity
- Server-wide policy restrictions
Recommended Fixes
- Ensure ACE OLEDB is installed
If you're using Microsoft.ACE.OLEDB.12.0
or 16.0
, make sure it's installed on the production server:
Important: The bitness (32-bit vs 64-bit) of your application pool must match the driver installed.
- Force Application Pool Bitness Compatibility
If you installed 64-bit ACE OLEDB, ensure Enable 32-Bit Applications is False in IIS:
- Go to IIS Manager → Application Pools
- Select
DefaultAppPool
→ Advanced Settings
- Set
Enable 32-Bit Applications
to False
(or True
if using 32-bit driver)
- Recycle the app pool
- Ensure proper file access and permissions
You mentioned giving the folder permissions to IIS APPPOOL\DefaultAppPool
, which is good, but also verify:
- The Excel file isn't locked or corrupted.
- The account running the pool (ApplicationPoolIdentity) has access to read Excel driver internals, which might need Desktop Interaction permissions.
- DO NOT use UNC paths unless you impersonate or set up delegation/kerberos properly.
- Add diagnostic logging to isolate the crash
Since the crash is native and hard, try logging the last known operation before SqlBulkCopy
. Use:
Try
' Log: Starting Excel Read
' Open OleDbConnection...
' Read into DataTable...
' Log: Finished reading Excel
' Log: Starting SQL Bulk Copy
' SqlBulkCopy operation
' Log: Finished SQL Bulk Copy
Catch ex As Exception
' Log full stack trace
File.AppendAllText("LOGS\errors.txt", Now.ToString() & " - " & ex.ToString())
End Try
This helps isolate if the crash occurs during Excel read or during SQL insert.
- Avoid OleDb for Excel in production
Better alternatives for production ETL from Excel:
- EPPlus or ClosedXML (read
.xlsx
natively without needing drivers or COM)
- These are pure .NET and won't crash the app pool
Why: OleDb for Excel is notoriously unstable in server environments.
If switching is feasible: use EPPlus
to read Excel, transform into DataTable
, and still use SqlBulkCopy
.
- Enable WER Dump for w3wp
Enable crash dump collection to get more insights:
reg add "HKLM\Software\Microsoft\Windows\Windows Error Reporting\LocalDumps\w3wp.exe" /v DumpType /t REG_DWORD /d 2 /f
reg add "HKLM\Software\Microsoft\Windows\Windows Error Reporting\LocalDumps\w3wp.exe" /v DumpCount /t REG_DWORD /d 10 /f
reg add "HKLM\Software\Microsoft\Windows\Windows Error Reporting\LocalDumps\w3wp.exe" /v DumpFolder /t REG_SZ /d C:\CrashDumps /f
Restart IIS. The next crash will generate a .dmp
file in C:\CrashDumps
for deeper analysis.
---Hope this helps.