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

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

How to produce single WASM file using WASI SDK C#

问题

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

  <PropertyGroup>
    <OutputType>Exe</OutputType>
    <TargetFramework>net8.0</TargetFramework>
    <RuntimeIdentifier>wasi-wasm</RuntimeIdentifier>
    <ImplicitUsings>enable</ImplicitUsings>
    <Nullable>enable</Nullable>
    <AllowUnsafeBlocks>true</AllowUnsafeBlocks>
  </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

  &lt;PropertyGroup&gt;
    &lt;OutputType&gt;Exe&lt;/OutputType&gt;
    &lt;TargetFramework&gt;net8.0&lt;/TargetFramework&gt;
    &lt;RuntimeIdentifier&gt;wasi-wasm&lt;/RuntimeIdentifier&gt;
    &lt;ImplicitUsings&gt;enable&lt;/ImplicitUsings&gt;
    &lt;Nullable&gt;enable&lt;/Nullable&gt;
    &lt;AllowUnsafeBlocks&gt;true&lt;/AllowUnsafeBlocks&gt;
  &lt;/PropertyGroup&gt;

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

答案1

得分: 1

<WasmSingleFileBundle>true</WasmSingleFileBundle>
英文:

You should use.

&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:

确定