NativeAOT + emscripten
Help!!!!! use following publish command to get js and wasm,while run the js. get the error as image, I've been troubled by this issue for half a month.
Command:call E:\emsdk-3.1.56\emsdk_env.bat
dotnet publish /p:NativeLib=Shared -r browser-wasm -c Release /p:TargetArchitecture=wasm /p:NativeDebugSymbols=false
pause
Project:
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Library</OutputType>
<TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<PlatformTarget>AnyCPU</PlatformTarget>
<InvariantGlobalization>false</InvariantGlobalization> <SelfContained>true</SelfContained> <MSBuildEnableWorkloadResolver>false</MSBuildEnableWorkloadResolver> <IlcDisableReflection>true</IlcDisableReflection> <IlcOptimizationPreference>Speed</IlcOptimizationPreference> <TrimMode>full</TrimMode> <PublishTrimmed>true</PublishTrimmed> <TrimmerRemoveSymbols>true</TrimmerRemoveSymbols> <EnableUnsafeUTF7Encoding>true</EnableUnsafeUTF7Encoding> <UseSystemResourceKeys>true</UseSystemResourceKeys> <PublishReadyToRunEmitSymbols>false</PublishReadyToRunEmitSymbols> </PropertyGroup> <ItemGroup> <PackageReference Include="Microsoft.DotNet.ILCompiler.LLVM" Version="10.0.0-" /> <PackageReference Include="runtime.win-x64.Microsoft.DotNet.ILCompiler.LLVM" Version="10.0.0-" /> </ItemGroup> </Project>
<InvariantGlobalization>false</InvariantGlobalization> <SelfContained>true</SelfContained> <MSBuildEnableWorkloadResolver>false</MSBuildEnableWorkloadResolver> <IlcDisableReflection>true</IlcDisableReflection> <IlcOptimizationPreference>Speed</IlcOptimizationPreference> <TrimMode>full</TrimMode> <PublishTrimmed>true</PublishTrimmed> <TrimmerRemoveSymbols>true</TrimmerRemoveSymbols> <EnableUnsafeUTF7Encoding>true</EnableUnsafeUTF7Encoding> <UseSystemResourceKeys>true</UseSystemResourceKeys> <PublishReadyToRunEmitSymbols>false</PublishReadyToRunEmitSymbols> </PropertyGroup> <ItemGroup> <PackageReference Include="Microsoft.DotNet.ILCompiler.LLVM" Version="10.0.0-" /> <PackageReference Include="runtime.win-x64.Microsoft.DotNet.ILCompiler.LLVM" Version="10.0.0-" /> </ItemGroup> </Project>

0 Replies