How to fix "Csc.exe" exited with code -1073741819

Orestis Georgatos 0 Reputation points
2025-11-19T15:50:00.85+00:00

i dont know what else to do, so im asking here

it happens with every project, even a simple writeline

so far ive tried

reinstalling visual studio

both repairing and reinstalling every single instance of .NET in my computer

running as administrator

virus scans

disabling my anti virus

deleting all nuget packages on my computer

repairing visual studio

uninstalling visual studio 2022 and use 2026,

disabling parallel building

and none of them have stopped the error


Moved from: Sysinternals

Developer technologies | Visual Studio | Other
Developer technologies | Visual Studio | Other
A family of Microsoft suites of integrated development tools for building applications for Windows, the web, mobile devices and many other platforms. Miscellaneous topics that do not fit into specific categories.
{count} votes

2 answers

Sort by: Most helpful
  1. Q&A Assist
    2025-11-19T15:51:29.6933333+00:00
    AI generated content. This question contains an answer created with AI from Q&A Assist. Learn more

    The error code -1073741819 typically indicates a problem with the execution of the C# compiler (csc.exe), which can be caused by various issues such as corrupted installations, missing dependencies, or conflicts with other software. Here are some steps you can try to troubleshoot and potentially resolve the issue:

    1. Check for System Updates: Ensure that your operating system is fully updated, as missing updates can sometimes cause compatibility issues.
    2. Run Visual Studio in Safe Mode: Start Visual Studio in Safe Mode to disable all extensions and see if the issue persists. You can do this by running the command devenv.exe /SafeMode from the command prompt.
    3. Check Environment Variables: Ensure that your system's environment variables, particularly the PATH variable, are set correctly and do not contain any invalid paths that could interfere with the compiler.
    4. Check for Conflicting Software: Sometimes, other software installed on your machine can conflict with Visual Studio. Consider temporarily uninstalling or disabling any recently installed software to see if it resolves the issue.
    5. Use Dependency Walker: You can use a tool like Dependency Walker to check for missing dependencies that csc.exe might require. This can help identify if there are any DLLs that are not being found.
    6. Check Event Viewer: Look in the Windows Event Viewer for any application errors that might provide more context about why csc.exe is failing.
    7. Reinstall .NET SDKs: Since you mentioned reinstalling .NET, ensure that you have the correct versions of the .NET SDKs installed that are compatible with your projects.
    8. Create a New User Profile: Sometimes, user profile corruption can lead to issues. Try creating a new user account on your machine and see if the problem persists when running Visual Studio from that account.

    If none of these steps resolve the issue, consider reaching out to Microsoft support or checking the Visual Studio Developer Community for similar issues reported by other users.


    References:

    0 comments No comments

  2. Danny Nguyen (WICLOUD CORPORATION) 4,160 Reputation points Microsoft External Staff Moderator
    2025-11-20T07:47:51.4533333+00:00

    Hi.

    I've seen this problem popping up recently. As Viorel has stated, this could be a problem with the newest SDK.

    You could try this check to confirm if this is the case, and also try the workaround below :

    1. Confirm which SDK is actually being used In a normal command prompt (not VS):
      
         dotnet --list-sdks
      
      
      If you see .NET SDK 10.0.100 installed, try creating and building a minimal repro from the command line:
      
         mkdir C:\Temp\HelloTest
      
         cd C:\Temp\HelloTest
      
         dotnet new console -f net10.0 -n HelloTest
      
         cd HelloTest
      
         dotnet build -v n
      
      
      If this fails with the same MSB6006 / csc.exe -1073741819, the problem is the SDK/compiler itself.
    2. Force projects to use a different SDK (workaround) Until the underlying issue is resolved on your machine, you can often get unblocked by pinning an earlier SDK version that works for you (for example 9.0.307):
      • In your solution folder, create a file called global.json with:
        
             {
        
               "sdk": {
        
                 "version": "9.0.307",
        
                 "rollForward": "latestMajor"
        
               }
        
             }
        
        
      • Then, in that same folder, run:
        
             dotnet --version
        
        
        and verify it prints 9.0.307.
      • After that, try dotnet build again, and also rebuild in Visual Studio.
      If builds start working again under 9.0.307, you at least have a practical workaround while you continue to troubleshoot the access violation with SDK 10.0.100.
    3. Delete all build artifacts and do a command‑line build Even though you’ve reinstalled/repair VS/.NET, it’s still worth doing a completely clean build from the command line:
      • Close Visual Studio.
      • In your solution root, delete every bin and obj folder in all projects.
      • Open a command prompt in the solution folder and run:
        
             dotnet clean
        
             dotnet build -v n
        
        
      This helps rule out stale build artifacts and also shows whether the failure happens outside VS.

    Hope this helps

    0 comments No comments

Your answer

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