Skip to content

EMCC command failing after .NET 10 update #121783

Closed as not planned
Closed as not planned

Description

@williambuchanan2

Is there an existing issue for this?

  • I have searched the existing issues

Describe the bug

I have a blazor wasm application. I have just tried to update to .NET 10 and I get the 2 errors below when trying to build:

The command "emcc "@C:\Program Files\dotnet\packs\Microsoft.NETCore.App.Runtime.Mono.browser-wasm\10.0.0\runtimes\browser-wasm\native\src\emcc-default.rsp" -msimd128 "@C:\Program Files\dotnet\packs\Microsoft.NETCore.App.Runtime.Mono.browser-wasm\10.0.0\runtimes\browser-wasm\native\src\emcc-link.rsp" "@C:\Ws\Repo\DEV\PDS\NetCore\Client\PDS.Web\Site\obj\Debug\net10.0\wasm\for-build\emcc-link.rsp"" exited with code 1.

/NODEFAULTLIB:MSVCRT: No such file or directory ("/NODEFAULTLIB:MSVCRT" was expected to be an input file, based on the commandline arguments provided)

Builds fine in .NET 9.

When I double click it takes me to BrowserWasmApp.targets at this line:

    <Exec Command='emcc "@$(_WasmDefaultFlagsRsp)" $(_WasmDefaultFlags) "@$(_WasmDefaultLinkFlagsRsp)" "@$(_WasmLinkRsp)"' EnvironmentVariables="@(EmscriptenEnvVars)" ConsoleToMSBuild="true">
      <Output TaskParameter="ConsoleOutput" PropertyName="_EmccLinkStepConsoleOutput" />
      <Output TaskParameter="ExitCode" PropertyName="_EmccLinkStepExitCode" />
    </Exec>

At this point i'm dead in the water so some help would be appreciated!

Any thoughts?

Expected Behavior

No build error

Steps To Reproduce

Update Blazor app to .NET 10

Exceptions (if any)

The command "emcc "@C:\Program Files\dotnet\packs\Microsoft.NETCore.App.Runtime.Mono.browser-wasm\10.0.0\runtimes\browser-wasm\native\src\emcc-default.rsp" -msimd128 "@C:\Program Files\dotnet\packs\Microsoft.NETCore.App.Runtime.Mono.browser-wasm\10.0.0\runtimes\browser-wasm\native\src\emcc-link.rsp" "@C:\Ws\Repo\DEV\PDS\NetCore\Client\PDS.Web\Site\obj\Debug\net10.0\wasm\for-build\emcc-link.rsp"" exited with code 1.

/NODEFAULTLIB:MSVCRT: No such file or directory ("/NODEFAULTLIB:MSVCRT" was expected to be an input file, based on the commandline arguments provided)

.NET Version

10

Anything else?

No response

Activity

  1. transferred this issue fromdotnet/aspnetcoreon Nov 19, 2025
  2. javiercn commented on Nov 19, 2025

    @javiercn
    Member
  3. williambuchanan2 commented on Nov 20, 2025

    @williambuchanan2
    Author

    I have an update on this. Problem wasn't happening on another developer's PC. The difference we noticed was that he hadn't installed the .NET 10 Runtime whereas I had. I uninstalled VS and everything .NET 10 related. The folder with the targets file still existed (C:\Program Files\dotnet\packs\Microsoft.NET.Runtime.WebAssembly.Sdk\10.0.0) so I renamed this folder. Rebooted and reinstalled VS2026 without installing other .NET packages and now the problem has gone.

  4. williambuchanan2 commented on Nov 21, 2025

    @williambuchanan2
    Author

    Today it started happening on Azure Devops pipeline:

    Linking with emcc with -O2. This may take a while ...
    ##[error]emcc(0,0): Error : /NODEFAULTLIB:MSVCRT: No such file or directory ("/NODEFAULTLIB:MSVCRT" was expected to be an input file, based on the commandline arguments provided)
    emcc : error : /NODEFAULTLIB:MSVCRT: No such file or directory ("/NODEFAULTLIB:MSVCRT" was expected to be an input file, based on the commandline arguments provided) [D:\a\1\s\NetCore\Client\PDS.Web\Site\PDS.Web.csproj]
    ##[error]C:\hostedtoolcache\windows\dotnet\packs\Microsoft.NET.Runtime.WebAssembly.Sdk\10.0.0\Sdk\BrowserWasmApp.targets(522,5): Error MSB3073: The command "emcc "@C:\hostedtoolcache\windows\dotnet\packs\Microsoft.NETCore.App.Runtime.Mono.browser-wasm\10.0.0\runtimes\browser-wasm\native\src\emcc-default.rsp" -msimd128 "@C:\hostedtoolcache\windows\dotnet\packs\Microsoft.NETCore.App.Runtime.Mono.browser-wasm\10.0.0\runtimes\browser-wasm\native\src\emcc-link.rsp" "@d:\a\1\s\NetCore\Client\PDS.Web\Site\obj\Release\net10.0\wasm\for-publish\emcc-link.rsp"" exited with code 1.
    C:\hostedtoolcache\windows\dotnet\packs\Microsoft.NET.Runtime.WebAssembly.Sdk\10.0.0\Sdk\BrowserWasmApp.targets(522,5): error MSB3073: The command "emcc "@C:\hostedtoolcache\windows\dotnet\packs\Microsoft.NETCore.App.Runtime.Mono.browser-wasm\10.0.0\runtimes\browser-wasm\native\src\emcc-default.rsp" -msimd128 "@C:\hostedtoolcache\windows\dotnet\packs\Microsoft.NETCore.App.Runtime.Mono.browser-wasm\10.0.0\runtimes\browser-wasm\native\src\emcc-link.rsp" "@d:\a\1\s\NetCore\Client\PDS.Web\Site\obj\Release\net10.0\wasm\for-publish\emcc-link.rsp"" exited with code 1. [D:\a\1\s\NetCore\Client\PDS.Web\Site\PDS.Web.csproj]

  5. erikdalle commented on Nov 21, 2025

    @erikdalle

    Same issue, found that we had this in our .csproj. Dont remember why but removing it seems to stop the error from occuring.
    <EmccInitialHeapSize>16777216</EmccInitialHeapSize>

  6. Filipowicz251 commented on Nov 22, 2025

    @Filipowicz251

    I have the same after upgrading to .NET 10

  7. williambuchanan2 commented on Nov 24, 2025

    @williambuchanan2
    Author

    Any updates on this? It's a complete show stoper for me at the moment.

  8. williambuchanan2 commented on Nov 24, 2025

    @williambuchanan2
    Author

    For anyone stuck on this, I have found a workaround. I don't make any guarantees about it but it seems to get past the problem for me.

    Add the following to your .csproj file:

        
        <Target Name="FilterWasmLinkerResponses" BeforeTargets="_BrowserWasmLinkDotNet">
            <!-- TODO: Remove when fixed. -->
            <Exec Command="powershell.exe -NoProfile -ExecutionPolicy Bypass -File &quot;$(MSBuildProjectDirectory)\FilterWasmLinks.ps1&quot; -RspPath &quot;$(MSBuildProjectDirectory)\obj\$(Configuration)\net10.0\wasm\for-build\emcc-link.rsp&quot;" ContinueOnError="true" />
            <Exec Command="powershell.exe -NoProfile -ExecutionPolicy Bypass -File &quot;$(MSBuildProjectDirectory)\FilterWasmLinks.ps1&quot; -RspPath &quot;$(MSBuildProjectDirectory)\obj\$(Configuration)\net10.0\wasm\for-publish\emcc-link.rsp&quot;" ContinueOnError="true" />
        </Target>
    

    And create a file in the root of your web application named 'FilterWasmLinks.ps1' which includes the below contents:

    param([string]$RspPath)
    
    if (Test-Path $RspPath) {
        $content = Get-Content $RspPath -Raw
        $filtered = $content -replace '/NODEFAULTLIB:[^\s]*', ''
        $filtered = $filtered -replace '-NODEFAULTLIB:[^\s]*', ''
        Set-Content $RspPath $filtered -NoNewline
        Write-Host "Filtered $RspPath"
    } else {
        Write-Host "File not found: $RspPath"
    }
    

    Hopefully it will get some of you out of trouble until a proper fix is in place...

  9. akoeplinger commented on Nov 24, 2025

    @akoeplinger
    Member

    @williambuchanan2 do you happen to reference the Sentry nuget package? They had a bug where they accidentally added this flag for all platforms when building on Windows. The fix for Browser targets is getsentry/sentry-dotnet#4631 which is in the 6.0.0-preview.2 version of the Sentry package. The fix for Android is pending on getsentry/sentry-dotnet#4760

  10. self-assigned this
    on Nov 24, 2025
  11. added this to the 11.0.0 milestone on Nov 24, 2025
  12. dotnet-policy-service commented on Nov 24, 2025

    @dotnet-policy-service
    Contributor

    Tagging subscribers to 'arch-wasm': @lewing, @pavelsavara
    See info in area-owners.md if you want to be subscribed.

  13. williambuchanan2 commented on Nov 24, 2025

    @williambuchanan2
    Author

    @williambuchanan2 do you happen to reference the Sentry nuget package? They had a bug where they accidentally added this flag for all platforms when building on Windows. The fix for Browser targets is getsentry/sentry-dotnet#4631 which is in the 6.0.0-preview.2 version of the Sentry package. The fix for Android is pending on getsentry/sentry-dotnet#4760

    @akoeplinger yes I do happen to be using Sentry! At least there is an explanation for it now... Thanks for the heads up - I will keep the workaround in place until they release a fix...

  14. akoeplinger commented on Nov 24, 2025

    @akoeplinger
    Member

    The Sentry 6.0.0-preview.2 version is already on nuget.org so you can give it a try if you only need the fix for Browser targets.

    I'll close this issue as this is not a runtime issue.

  15. added
    tracking-external-issueThe issue is caused by external problem (e.g. OS) - nothing we can do to fix it directly
    on Nov 24, 2025
  16. locked and limited conversation to collaborators on Dec 25, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

arch-wasmWebAssembly architecturearea-Build-monotracking-external-issueThe issue is caused by external problem (e.g. OS) - nothing we can do to fix it directly

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions