© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
C#C
C#•5mo ago
garyzhlei

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>
F8F6C7CC-9151-4b1f-9D2B-DCE812B74BAB.png
C# banner
C#Join
We are a programming server aimed at coders discussing everything related to C# (CSharp) and .NET.
61,871Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

NativeAOT multiple Dlls
C#CC# / help
5w ago
NativeAOT Serialization Troubles
C#CC# / help
11mo ago
✅ COM + NativeAOT Help
C#CC# / help
2y ago
Include File into Blazor Emscripten VFS
C#CC# / help
14mo ago