Skip to content

csc.exe crashes with exit code -1073741819 (0xC0000005) with .NET SDK 10.0.100 on Windows 10 (VS 2026) #121596

Closed

Description

@equmagg

On my system, any project that uses .NET SDK 10.0.100 (for any target) fails to build with error MSB6006: "csc.exe" exited with code -1073741819.
The problem appears only when SDK 10.0.100 is installed, while running the compiler directly does not crash.
Projects targeting net9.0 and lower build successfully as long as sdk 10 is not installed.
Both MSI and binary installations produce the same results. VS Repair did not help either. <UseSharedCompilation>false</UseSharedCompilation> was also attempted.

to reproduce

mkdir C:\Temp\HelloTest
cd C:\Temp\HelloTest

dotnet new console -f net10.0 -n HelloTest
cd HelloTest

dotnet build -v n
HelloTest net10.0 failed with errors (1)
C:\Program Files\dotnet\sdk\10.0.100\Roslyn\Microsoft.CSharp.Core.targets(84,5): error MSB6006: "csc.exe" exited with code -1073741819.

dotnet --info:

.NET SDK Information:
 Version:           10.0.100
 Commit:            b0f34d51fc
 Workload version:  10.0.100-manifests.355811b7
 MSBuild version:   18.0.2+b0f34d51f

Runtime Environment:
 OS Name:     Windows
 OS Version:  10.0.19045
 OS Platform: Windows
 RID:         win-x64
 Base Path:   C:\Program Files\dotnet\sdk\10.0.100\

Installed .NET Workloads:
 [wasm-tools]
   Installation source: VS 18.0.11205.157, VS 17.14.36705.20
   Manifest version:    10.0.100/10.0.100
   Manifest path:       C:\Program Files\dotnet\sdk-manifests\10.0.100\microsoft.net.workload.mono.toolchain.current\10.0.100\WorkloadManifest.json
   Installation type:              Msi

Configured to use workload sets for installing new manifests.
No workload sets are installed. Run dotnet workload restore to install a workload set.

Host:
  Version:      10.0.0
  Architecture: x64
  Commit:       b0f34d51fc

.NET SDKs installed:
  5.0.400 [C:\Program Files\dotnet\sdk]
  6.0.428 [C:\Program Files\dotnet\sdk]
  8.0.412 [C:\Program Files\dotnet\sdk]
  9.0.307 [C:\Program Files\dotnet\sdk]
  10.0.100 [C:\Program Files\dotnet\sdk]

.NET runtimes installed:
  Microsoft.AspNetCore.App 3.1.18 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 3.1.32 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 5.0.9 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 5.0.17 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 6.0.36 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 8.0.18 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 8.0.22 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 9.0.11 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 10.0.0 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.NETCore.App 3.1.18 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 3.1.32 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 5.0.9 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 5.0.17 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 6.0.11 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 6.0.36 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 8.0.18 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 8.0.22 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 9.0.11 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 10.0.0 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.WindowsDesktop.App 3.1.18 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
  Microsoft.WindowsDesktop.App 3.1.32 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
  Microsoft.WindowsDesktop.App 5.0.9 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
  Microsoft.WindowsDesktop.App 5.0.17 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
  Microsoft.WindowsDesktop.App 6.0.11 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
  Microsoft.WindowsDesktop.App 6.0.36 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
  Microsoft.WindowsDesktop.App 8.0.18 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
  Microsoft.WindowsDesktop.App 8.0.22 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
  Microsoft.WindowsDesktop.App 9.0.11 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
  Microsoft.WindowsDesktop.App 10.0.0 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]

Other architectures found:
  x86   [C:\Program Files (x86)\dotnet]
    registered at [HKLM\SOFTWARE\dotnet\Setup\InstalledVersions\x86\InstallLocation]

Environment variables:
  Not set

global.json file:
  Not found

Learn more:
  https://aka.ms/dotnet/info

Download .NET:
  https://aka.ms/dotnet/download

I am attaching csc.exe crash dump as well

csc.exe.15004.dmp.zip

Activity

  1. added
    untriaged
    on Nov 13, 2025
  2. added
    area-Workloads
    on Nov 13, 2025
  3. jjonescz commented on Nov 13, 2025

    @jjonescz
    Member

    That exit code means "access violation" and I can see it's happening inside the apphost - this is the stack trace from debugging the dmp file:

    Unhandled exception at 0x00007FF8C577A8E4 (coreclr.dll) in csc.exe.15004.dmp: 0xC0000005: Access violation reading location 0x0000000000000004.
    
    >	ntdll.dll!00007ff98c3716e6()	
     	hostpolicy.dll!00007ff96a5a3891()	
     	hostpolicy.dll!00007ff96a5bcbe5()	
     	hostpolicy.dll!00007ff96a5beedf()	
     	hostfxr.dll!00007ff96a60d56b()	
     	hostfxr.dll!00007ff96a61029c()	
     	hostfxr.dll!00007ff96a612676()	
     	hostfxr.dll!00007ff96a61079d()	
     	hostfxr.dll!00007ff96a608998()	
     	csc.exe!00007ff6e8f92f48()	
     	csc.exe!00007ff6e8f933c6()	
     	csc.exe!00007ff6e8fa3b08()	
     	kernel32.dll!00007ff98c147034()	
     	ntdll.dll!00007ff98c3226a1()	
    

    cc @agocke

    @equmagg can you try setting trace env vars to get more logs from the apphost execution?

  4. equmagg commented on Nov 13, 2025

    @equmagg
    ContributorAuthor
  5. added and removed
    area-Workloads
    on Nov 13, 2025
  6. agocke commented on Nov 13, 2025

    @agocke
    Member

    Since the code is crashing in ntdll, I think a dump file would be most useful. Could you collect a dump by following the instructions at https://learn.microsoft.com/en-us/windows/win32/wer/collecting-user-mode-dumps?

    If you want to keep it private, you could create a bug at https://developercommunity.visualstudio.com/dotnet, which should allow you to attach a private dump file that we can access.

    I see you already collected a dump. Thanks! We'll take a look

  7. transferred this issue fromdotnet/sdkon Nov 13, 2025
  8. agocke commented on Nov 13, 2025

    @agocke
    Member
  9. added this to the 10.0.x milestone on Nov 13, 2025
  10. removed
    untriaged
    on Nov 13, 2025
  11. agocke commented on Nov 13, 2025

    @agocke
    Member

    Ah, I see the failing stack is actually in coreclr:

    STACK_TEXT:  
    00000023`1d9ce6f8 00007ff8`c5854f0e coreclr!ThreadStore::HoldingThreadStore+0x15b842
    00000023`1d9ce700 00007ff8`c59a2523 coreclr!EEPolicy::HandleFatalError+0xdb
    00000023`1d9ced00 00007ff8`c5860532 coreclr!Thread::StaticInitialize+0x14639a
    00000023`1d9ced00 00007ff8`c5860532 coreclr!EEStartupHelper+0x146562
    00000023`1d9cee00 00007ff8`c57d5cf9 coreclr!EEStartup+0x2d
    00000023`1d9cee40 00007ff8`c57d5c96 coreclr!EnsureEEStarted+0x96
    00000023`1d9cee80 00007ff8`c57d5bbe coreclr!CorHost2::Start+0x4e
    00000023`1d9ceec0 00007ff8`c57f72ef coreclr!coreclr_initialize+0x15f
    00000023`1d9cef90 00007ff9`6a5a3891 hostpolicy!coreclr_t::create+0x2e1
    00000023`1d9cf110 00007ff9`6a5bcbe5 hostpolicy!`anonymous namespace'::create_coreclr+0x165
    00000023`1d9cf170 00007ff9`6a5beedf hostpolicy!corehost_main+0x15f
    00000023`1d9cf270 00007ff9`6a60d56b hostfxr!execute_app+0x2bb
    00000023`1d9cf300 00007ff9`6a61029c hostfxr!`anonymous namespace'::read_config_and_execute+0xac
    00000023`1d9cf400 00007ff9`6a612676 hostfxr!fx_muxer_t::handle_exec_host_command+0x1d6
    00000023`1d9cf4b0 00007ff9`6a61079d hostfxr!fx_muxer_t::execute+0x2ad
    00000023`1d9cf5e0 00007ff9`6a608998 hostfxr!hostfxr_main_startupinfo+0xa8
    00000023`1d9cf6e0 00007ff6`e8f92f48 csc!exe_start+0xaa8
    00000023`1d9cf890 00007ff6`e8f933c6 csc!wmain+0x156
    00000023`1d9cf910 00007ff6`e8fa3b08 csc!invoke_main+0x22
    00000023`1d9cf910 00007ff6`e8fa3b08 csc!__scrt_common_main_seh+0x10c
    00000023`1d9cf950 00007ff9`8c147034 kernel32!BaseThreadInitThunk+0x14
    00000023`1d9cf980 00007ff9`8c3226a1 ntdll!RtlUserThreadStart+0x21
    
  12. agocke commented on Nov 13, 2025

    @agocke
    Member

    @elinor-fung can you take a look?

  13. agocke commented on Nov 13, 2025

    @agocke
    Member

    @equmagg It looks like this is failing in the setup for the CET security feature, which is on-by-default for csc.exe in .NET 10. Since you're using Windows 10, can you make sure you're fully up-to-date on Windows patches? Early versions of Windows 10 had some CET bugs that caused these kinds of failures, but they should all be fixed in the very latest builds.

  14. added a commit that references this issue on Nov 13, 2025
    1c12b9b
  15. jkotas commented on Nov 13, 2025

    @jkotas
    Member

    #121602 is fixing the error message (we crash while trying to print the error message).

  16. added a commit that references this issue on Nov 14, 2025
    6ec6e4c
  17. added a commit that references this issue on Nov 14, 2025
    39d4138
  18. twm1005 commented on Nov 20, 2025

    @twm1005

    I'm running into the exact same issue.

    You mentioned that it's failing during setup for the CET security feature, which is enabled by default for csc.exe in .NET 10. Since you're on Windows 10, could you verify that all the latest Windows updates are installed? It looks like csc is crashing instead of showing a proper warning or error message, but that still doesn't seem to address the root problem.

    For reference, I'm on Windows 11 (my dotnet --info reports OS Version: 10.0.22000), and I'm fully patched through Windows Update.

  19. jkotas commented on Nov 20, 2025

    @jkotas
    Member

    dotnet --info reports OS Version: 10.0.22000

    If you are on fully patched Windows 11, your dotnet --info should report OS Version: 10.0.26200.

  20. twm1005 commented on Nov 20, 2025

    @twm1005

    I'm all set now. Windows Update had been telling me I was up to date, but that turned out not to be true—even after clicking “Check for updates” several times. After I posted my comment, my system actually crashed, which helped reveal that something was wrong with Windows Update.

    Once I restarted a few services, Windows Update finally pulled in a series of updates. After installing them, I’m now able to build my solutions without any issues. Now I need to work on updating my version of 21H2 to the latest.

  21. kseroff commented on Nov 21, 2025

    @kseroff

    I am another victim of this problem. Only in my case, the Windows 10 22h2 version should be saved, according to my terms of reference, it is on the list and several more linux distributions. What is the chance that everything will be normal on them too? I can't answer that either.
    .Net 9 also has a problem after upgrading from csc, as if they are forced to go down to .NET 8 or go to QT.

  22. locked and limited conversation to collaborators on Dec 22, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    • Status
      No status

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions