Search code examples
.netblazoraot

Blazor AOT fails with "The command "emcc --version" exited with code -1073741515"


I'm trying to run the publishing of the Blazor application. I have installed DotNet6 Preview6, AOT workload.

When I run publishing, I get the next error message:

C:\Program Files\dotnet\packs\Microsoft.NET.Runtime.WebAssembly.Sdk\6.0.0-preview.6.21352.12\Sdk\WasmApp.Native.targets(316,5): error MSB3073: The command "emcc --version" exited with code -1073741515.

What can be a reason?


Solution

  • We have found the reason. It happens because emcc can not run Python, which is located at C:\Program Files\dotnet\packs\Microsoft.NET.Runtime.Emscripten.2.0.21.Python.win-x64\6.0.0-preview.6.21275.1\tools . This package includes Python 3.9, and it does not work on Windows Server 2008R2.

    The solution: we need to migrate to a recent Windows Server.

    Temporary Workaround: in the file C:\Program Files\dotnet\packs\Microsoft.NET.Runtime.Emscripten.2.0.21.Python.win-x64\6.0.0-preview.6.21275.1\Sdk\Sdk.props override the variable EMSDK_PYTHON and point it to python 3.8