如何使用 WASI SDK C# 生成单个 WASM 文件

huangapple go评论177阅读模式
英文:

How to produce single WASM file using WASI SDK C#

问题

如何使用.NET WASI SDK生成单个WASM文件?这是我的项目文件:

  1. <PropertyGroup>
  2. <OutputType>Exe</OutputType>
  3. <TargetFramework>net8.0</TargetFramework>
  4. <RuntimeIdentifier>wasi-wasm</RuntimeIdentifier>
  5. <ImplicitUsings>enable</ImplicitUsings>
  6. <Nullable>enable</Nullable>
  7. <AllowUnsafeBlocks>true</AllowUnsafeBlocks>
  8. </PropertyGroup>

目前WASI SDK生成dotnet.wasm + myapp.dll,但我想要dotnet.wasm + myapp.wasm。

英文:

How to produce single WASM file using .NET WASI SDK? Here is my project file

  1. &lt;PropertyGroup&gt;
  2. &lt;OutputType&gt;Exe&lt;/OutputType&gt;
  3. &lt;TargetFramework&gt;net8.0&lt;/TargetFramework&gt;
  4. &lt;RuntimeIdentifier&gt;wasi-wasm&lt;/RuntimeIdentifier&gt;
  5. &lt;ImplicitUsings&gt;enable&lt;/ImplicitUsings&gt;
  6. &lt;Nullable&gt;enable&lt;/Nullable&gt;
  7. &lt;AllowUnsafeBlocks&gt;true&lt;/AllowUnsafeBlocks&gt;
  8. &lt;/PropertyGroup&gt;

Currently WASI SDK produce dotnet.wasm + myapp.dll, but I would like to have dotnet.wasm + myapp.wasm

答案1

得分: 1

  1. <WasmSingleFileBundle>true</WasmSingleFileBundle>
英文:

You should use.

  1. &lt;WasmSingleFileBundle&gt;true&lt;/WasmSingleFileBundle&gt;

huangapple
  • 本文由 发表于 2023年5月29日 16:15:20
  • 转载请务必保留本文链接:https://go.coder-hub.com/76355687.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定