ASP.NET web site fail to critical error in ETL of Excel file

Nelson Javier Bahamon Parrado 0 Reputation points
2025-01-15T21:44:17.87+00:00

I have a website with a single web page on ASP.NET that you need to upload a file in Excel to a folder within the website, extract its contents to insert the data into a table in a database in SQL Server.

When testing its operation on the production web server it shows an error that prevents the process from being carried out in its entirety, the process involved is w3wp.exe; in addition, it can stop the IIS Connection Pool from working.

Error message extracted from Event Viewer

Faulting application name: w3wp.exe, version: 10.0.20348.1, time stamp: 0x405e4c14 Faulting module name: KERNELBASE.dll, version: 10.0.20348.2849, time stamp: 0x6f1cf41e Exception code: 0xe06d7363 Fault offset: 0x000000000003f14c Faulting process id: 0x244c Faulting application start time: 0x01db66a8a60c7bba Faulting application path: c:\windows\system32\inetsrv\w3wp.exe Faulting module path: C:\Windows\System32\KERNELBASE.dll Report Id: 7629be57-6b8a-4716-a8bb-1a20a06c196a Faulting package full name: Faulting package-relative application ID:

 Information message extracted from Event Viewer

Fault bucket , type 0

Event Name: APPCRASH Response: Not available Cab Id: 0   Problem signature: P1: w3wp.exe P2: 10.0.20348.1 P3: 405e4c14 P4: KERNELBASE.dll P5: 10.0.20348.2849 P6: 6f1cf41e P7: e06d7363 P8: 000000000003f14c P9: P10:   Attached files: \?\C:\Windows\TEMP{92305F1D-6BC3-4152-BEDF-76413C6DB647} - OProcSessId.dat \?\C:\ProgramData\Microsoft\Windows\WER\Temp\WER.c24ade36-f592-4060-aa94-fdb7b6e22aac.tmp.dmp \?\C:\ProgramData\Microsoft\Windows\WER\Temp\WER.eaad08b4-6009-4835-81aa-2634acdfff4c.tmp.WERInternalMetadata.xml \?\C:\ProgramData\Microsoft\Windows\WER\Temp\WER.147aa031-b06a-4e53-b5a2-ea499d9c142c.tmp.xml \?\C:\ProgramData\Microsoft\Windows\WER\Temp\WER.ddec9d82-81d1-4eda-bfb5-a7c7c5842f51.tmp.csv \?\C:\ProgramData\Microsoft\Windows\WER\Temp\WER.f51658fe-fcbf-4ba7-8ccd-070c4feb37ef.tmp.txt   These files may be available here:     Analysis symbol: Rechecking for solution: 0 Report Id: a6f7dcd2-17f7-46c9-b145-0024196c1a15 Report Status: 134217728 Hashed bucket: Cab Guid: 0

Software Development Context

  • Web page in ASP.NET Classic
  • Code behind VB.NET
  • .NET Framework 4.8
  • Ajax control toolkit ver. 20
  • IIS - Internet Information Server ver. 21H2
  • IIS – Pool connection, ver .NET CLR v4.0
  • SQL Server 2019 (RTM) - 15.0.2000.5 (X64)   Standard Edition (64-bit)
  • Windows Server 2022 Standard 10.0

Description of development

ETL of an Excel file to bring its contents to a SQL SERVER table using:

  • OleDbConnection y OleDbCommand (System.Data.OleDb) to extract dato from Excel file.
  • Data table (System.Data) to perform transformations on the data in memory.
  • SqlBulkCopy to perform the mass loading of existing data in Data table to a table in SQL Server.

Other settings

  • Add TRY CATCH to log error messages to a plain text file located in the LOGS folder of the website.
  • Creation of UPLOADS folder where the Excel files uploaded to the website will be located.
  • Assign Read, Write and Read & Execute permissions to the UPLOADS folder to the DefaultAppPool account (IIS APPPOOL\DefaultAppPool)
  • IIS – Application Pools, name: DefaultAppPool; process model – Identity: ApplicationPoolIdentity 

Tests performed

  • Successful test from local development environment in Visual Studio connecting to local database.
  • Successful test from website published in local IIS in development environment connecting to local database.
  • Successful test from local development environment in Visual Studio connecting to production environment database located on another server.
  • IDE Visual Studio 2022
Windows development | Internet Information Services
Microsoft 365 and Office | Excel | For business | Windows
Developer technologies | ASP.NET | Other
{count} votes

2 answers

Sort by: Most helpful
  1. Bruce (SqlWork.com) 79,101 Reputation points Volunteer Moderator
    2025-01-15T21:53:36.05+00:00

    W3wp.exe is the process that host the app domain. As your code is crashing you can not catch the error. You should look at the crash dump file for more information. A crash recycles the app pool.

    crashes are typically caused by native code. You could add some trace code.

    0 comments No comments

  2. Danny Nguyen (WICLOUD CORPORATION) 800 Reputation points Microsoft External Staff
    2025-07-24T09:50:54.8033333+00:00

    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: 0xe06d7363C++ 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

    1. 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.

    1. Force Application Pool Bitness Compatibility

    If you installed 64-bit ACE OLEDB, ensure Enable 32-Bit Applications is False in IIS:

    1. Go to IIS Manager → Application Pools
    2. Select DefaultAppPoolAdvanced Settings
    3. Set Enable 32-Bit Applications to False (or True if using 32-bit driver)
    4. Recycle the app pool

    1. 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.

    1. 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.


    1. 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.


    1. 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.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.