From 925c2961ecbfba2671fc2aadbac0bc480aea7ab8 Mon Sep 17 00:00:00 2001 From: Gerard Smit Date: Tue, 16 Sep 2025 22:33:01 +0200 Subject: [PATCH 1/7] Change to project SDK --- .github/workflows/build.yml | 2 +- .gitignore | 2 + Directory.Build.props | 36 ++++++++++++++++ Directory.Packages.props | 4 -- README.md | 42 +++++++------------ samples/calculator/Adder/Adder.csproj | 1 - .../CalculatorComposed.csproj | 1 - .../CalculatorHost/CalculatorHost.csproj | 1 - src/WasmComponent.Sdk/ImportInDev.proj | 3 -- src/WasmComponent.Sdk/Version.xml | 7 ++++ .../WasmComponent.Sdk.csproj | 13 +++--- ...lliance.Componentize.DotNet.Wasm.SDK.props | 8 +++- src/WasmComponent.Sdk/sdk/Sdk.props | 9 ++++ src/WasmComponent.Sdk/sdk/Sdk.targets | 4 ++ ...nce.Componentize.DotNet.WitBindgen.targets | 2 +- ...iance.Componentize.DotNet.Templates.csproj | 5 +++ .../wasi-cli/.template.config/template.json | 7 ---- templates/content/wasi-cli/wasi-cli.csproj | 21 ---------- templates/wasi-cli.xml | 12 ++++++ test/E2ETest/PackageTest/PackageTest.csproj | 1 - .../testapps/E2EConsumer/E2EConsumer.csproj | 4 +- .../testapps/E2EProducer/E2EProducer.csproj | 4 +- .../WasmComponentSdkTest.csproj | 1 - .../AppWithWitFolder/AppWithWitFolder.csproj | 1 - .../testapps/OciWit/OciWit.csproj | 1 - .../SimpleConsumer/SimpleConsumer.csproj | 1 - .../SimpleProducer/SimpleProducer.csproj | 1 - .../LibraryUsingWit/LibraryUsingWit.csproj | 1 - ...aryWithCustomGeneratedFilesLocation.csproj | 1 - .../LibraryWitExceptions.csproj | 1 - .../LibraryWithWitResultType.csproj | 1 - 31 files changed, 111 insertions(+), 87 deletions(-) create mode 100644 src/WasmComponent.Sdk/Version.xml create mode 100644 src/WasmComponent.Sdk/sdk/Sdk.props create mode 100644 src/WasmComponent.Sdk/sdk/Sdk.targets delete mode 100644 templates/content/wasi-cli/wasi-cli.csproj create mode 100644 templates/wasi-cli.xml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 6e235f6..f62b5da 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -39,7 +39,7 @@ jobs: run: | ls ./artifacts/*.nupkg version=$(unzip -p ./artifacts/*SDK*.nupkg '*.nuspec' | grep -oE "[^<]+" | sed 's///' | grep -oE "^[0-9]+\.[0-9]+\.[0-9]+-preview") - template_version=$(grep -oE "Version=\"[^\"]+" ./templates/content/wasi-cli/wasi-cli.csproj | sed 's/Version="//' | grep -oE "^[0-9]+\.[0-9]+\.[0-9]+-preview") + template_version=$(grep -oE 'Sdk="BytecodeAlliance.Componentize.DotNet.Wasm.SDK/[^"]+' ./templates/content/wasi-cli/wasi-cli.csproj | sed 's/Sdk="BytecodeAlliance.Componentize.DotNet.Wasm.SDK\///' | grep -oE "^[0-9]+\.[0-9]+\.[0-9]+-preview") echo "Package Version: $version | Template version: $template_version" if [ "$version" != "$template_version" ]; then echo "Version mismatch: Package version ($version) does not match template version ($template_version)"; diff --git a/.gitignore b/.gitignore index 0a06dc8..5b3c375 100644 --- a/.gitignore +++ b/.gitignore @@ -5,3 +5,5 @@ artifacts/ test/WasmComponentSdkTest/testapps/OciWit/wit/*.wasm *.binlog .DS_Store +templates/content/wasi-cli/wasi-cli.csproj +src/WasmComponent.Sdk/sdk/Version.props \ No newline at end of file diff --git a/Directory.Build.props b/Directory.Build.props index 08ca89b..0c7a828 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -18,4 +18,40 @@ 30.0.2 + + + + + + + + + + + + + + \n\n" + + result + ); + } + ]]> + + + + diff --git a/Directory.Packages.props b/Directory.Packages.props index 8e653e8..dee35d9 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -3,10 +3,6 @@ true - - - - diff --git a/README.md b/README.md index 41b543c..cebf177 100644 --- a/README.md +++ b/README.md @@ -265,32 +265,22 @@ Create a `nuget.config` file and add the `dotnet-experimental` package source fo ``` - -Add the `componentize-dotnet` package: - -`dotnet add package BytecodeAlliance.Componentize.DotNet.Wasm.SDK --prerelease` - -Add the platform specific LLVM package: - -``` -## On Linux -dotnet add package runtime.linux-x64.microsoft.dotnet.ilcompiler.llvm --prerelease - -## or - -## On Windows -dotnet add package runtime.win-x64.microsoft.dotnet.ilcompiler.llvm --prerelease -``` - -Edit the `.csproj` file, adding the following inside the ``: - -``` -wasi-wasm -false -true -true -true -``` +Edit the `.csproj` file: + +1. Change the SDK to `BytecodeAlliance.Componentize.DotNet.Wasm.SDK/[VERSION]`, for example: + + ```xml + + ``` +2. Add the following inside the ``: + + ```xml + wasi-wasm + false + true + true + true + ``` Now you can `dotnet build` to produce a `.wasm` file using NativeAOT compilation. diff --git a/samples/calculator/Adder/Adder.csproj b/samples/calculator/Adder/Adder.csproj index 3909d08..dbf2a8c 100644 --- a/samples/calculator/Adder/Adder.csproj +++ b/samples/calculator/Adder/Adder.csproj @@ -17,7 +17,6 @@ - diff --git a/samples/calculator/CalculatorComposed/CalculatorComposed.csproj b/samples/calculator/CalculatorComposed/CalculatorComposed.csproj index 786cffc..683f376 100644 --- a/samples/calculator/CalculatorComposed/CalculatorComposed.csproj +++ b/samples/calculator/CalculatorComposed/CalculatorComposed.csproj @@ -13,7 +13,6 @@ - diff --git a/samples/calculator/CalculatorHost/CalculatorHost.csproj b/samples/calculator/CalculatorHost/CalculatorHost.csproj index ab2c1a8..730b3ae 100644 --- a/samples/calculator/CalculatorHost/CalculatorHost.csproj +++ b/samples/calculator/CalculatorHost/CalculatorHost.csproj @@ -14,7 +14,6 @@ - diff --git a/src/WasmComponent.Sdk/ImportInDev.proj b/src/WasmComponent.Sdk/ImportInDev.proj index b1d936b..066fcce 100644 --- a/src/WasmComponent.Sdk/ImportInDev.proj +++ b/src/WasmComponent.Sdk/ImportInDev.proj @@ -4,7 +4,4 @@ - - - diff --git a/src/WasmComponent.Sdk/Version.xml b/src/WasmComponent.Sdk/Version.xml new file mode 100644 index 0000000..497c28d --- /dev/null +++ b/src/WasmComponent.Sdk/Version.xml @@ -0,0 +1,7 @@ + + + + $version$ + + + \ No newline at end of file diff --git a/src/WasmComponent.Sdk/WasmComponent.Sdk.csproj b/src/WasmComponent.Sdk/WasmComponent.Sdk.csproj index 6f4286f..1921457 100644 --- a/src/WasmComponent.Sdk/WasmComponent.Sdk.csproj +++ b/src/WasmComponent.Sdk/WasmComponent.Sdk.csproj @@ -34,10 +34,6 @@ tar - - - - @@ -106,8 +102,15 @@ + + + - <_PackageFiles Include="build\**" BuildAction="Content" PackagePath="build" /> + <_PackageFiles Include="sdk\**" BuildAction="Content" PackagePath="Sdk" /> + <_PackageFiles Include="build\**" BuildAction="Content" PackagePath="Sdk" /> <_PackageFiles Include="tools\**" BuildAction="Content" PackagePath="tools" /> diff --git a/src/WasmComponent.Sdk/build/BytecodeAlliance.Componentize.DotNet.Wasm.SDK.props b/src/WasmComponent.Sdk/build/BytecodeAlliance.Componentize.DotNet.Wasm.SDK.props index a6f34e1..33aaaca 100644 --- a/src/WasmComponent.Sdk/build/BytecodeAlliance.Componentize.DotNet.Wasm.SDK.props +++ b/src/WasmComponent.Sdk/build/BytecodeAlliance.Componentize.DotNet.Wasm.SDK.props @@ -19,9 +19,13 @@ $(MSBuildThisFileDirectory)..\tools\$(ToolsTarget)\wac $(WacExe).exe + + + 10.0.0-alpha.1.25162.1 - - + + + diff --git a/src/WasmComponent.Sdk/sdk/Sdk.props b/src/WasmComponent.Sdk/sdk/Sdk.props new file mode 100644 index 0000000..fd29aec --- /dev/null +++ b/src/WasmComponent.Sdk/sdk/Sdk.props @@ -0,0 +1,9 @@ + + + + + + + + + \ No newline at end of file diff --git a/src/WasmComponent.Sdk/sdk/Sdk.targets b/src/WasmComponent.Sdk/sdk/Sdk.targets new file mode 100644 index 0000000..b916e31 --- /dev/null +++ b/src/WasmComponent.Sdk/sdk/Sdk.targets @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/src/WitBindgen/build/BytecodeAlliance.Componentize.DotNet.WitBindgen.targets b/src/WitBindgen/build/BytecodeAlliance.Componentize.DotNet.WitBindgen.targets index e6c516e..065ec06 100644 --- a/src/WitBindgen/build/BytecodeAlliance.Componentize.DotNet.WitBindgen.targets +++ b/src/WitBindgen/build/BytecodeAlliance.Componentize.DotNet.WitBindgen.targets @@ -1,4 +1,5 @@  + native-aot @@ -8,7 +9,6 @@ https://github.com/WebAssembly/wasi-sdk/releases/download/wasi-sdk-$(WasiSdkVersion.Split(".")[0])/wasi-sdk-$(WasiSdkVersion)-x86_64-linux.tar.gz https://github.com/WebAssembly/wasi-sdk/releases/download/wasi-sdk-$(WasiSdkVersion.Split(".")[0])/wasi-sdk-$(WasiSdkVersion)-x86_64-macos.tar.gz $([System.IO.Path]::Combine("$([System.Environment]::GetFolderPath(SpecialFolder.UserProfile))", ".wasi-sdk", "wasi-sdk-$(WasiSdkVersion)")) - diff --git a/templates/BytecodeAlliance.Componentize.DotNet.Templates.csproj b/templates/BytecodeAlliance.Componentize.DotNet.Templates.csproj index fc4c3c0..e164564 100644 --- a/templates/BytecodeAlliance.Componentize.DotNet.Templates.csproj +++ b/templates/BytecodeAlliance.Componentize.DotNet.Templates.csproj @@ -42,4 +42,9 @@ + + + + + diff --git a/templates/content/wasi-cli/.template.config/template.json b/templates/content/wasi-cli/.template.config/template.json index 18386a5..bdaa014 100644 --- a/templates/content/wasi-cli/.template.config/template.json +++ b/templates/content/wasi-cli/.template.config/template.json @@ -14,13 +14,6 @@ "language": "C#", "type": "project" }, - "symbols": { - "platform": { - "type": "bind", - "binding": "env:OS", - "defaultValue": "linux" - } - }, "postActions": [ { "description": "Welcome to Componetize dotnet", diff --git a/templates/content/wasi-cli/wasi-cli.csproj b/templates/content/wasi-cli/wasi-cli.csproj deleted file mode 100644 index 0e706fc..0000000 --- a/templates/content/wasi-cli/wasi-cli.csproj +++ /dev/null @@ -1,21 +0,0 @@ - - - - Exe - net10.0 - wasi_cli - enable - enable - wasi-wasm - false - true - true - true - - - - - - - - diff --git a/templates/wasi-cli.xml b/templates/wasi-cli.xml new file mode 100644 index 0000000..b854096 --- /dev/null +++ b/templates/wasi-cli.xml @@ -0,0 +1,12 @@ + + + + Exe + net10.0 + wasi_cli + enable + enable + true + + + diff --git a/test/E2ETest/PackageTest/PackageTest.csproj b/test/E2ETest/PackageTest/PackageTest.csproj index 4e5e093..50bd58a 100644 --- a/test/E2ETest/PackageTest/PackageTest.csproj +++ b/test/E2ETest/PackageTest/PackageTest.csproj @@ -28,7 +28,6 @@ - diff --git a/test/E2ETest/testapps/E2EConsumer/E2EConsumer.csproj b/test/E2ETest/testapps/E2EConsumer/E2EConsumer.csproj index aca4445..f33f8d9 100644 --- a/test/E2ETest/testapps/E2EConsumer/E2EConsumer.csproj +++ b/test/E2ETest/testapps/E2EConsumer/E2EConsumer.csproj @@ -1,6 +1,7 @@  - + + Exe @@ -19,7 +20,6 @@ - diff --git a/test/E2ETest/testapps/E2EProducer/E2EProducer.csproj b/test/E2ETest/testapps/E2EProducer/E2EProducer.csproj index 425b924..09c8090 100644 --- a/test/E2ETest/testapps/E2EProducer/E2EProducer.csproj +++ b/test/E2ETest/testapps/E2EProducer/E2EProducer.csproj @@ -1,6 +1,7 @@  - + + net10.0 @@ -17,7 +18,6 @@ - diff --git a/test/WasmComponentSdkTest/WasmComponentSdkTest/WasmComponentSdkTest.csproj b/test/WasmComponentSdkTest/WasmComponentSdkTest/WasmComponentSdkTest.csproj index acd75a5..0672933 100644 --- a/test/WasmComponentSdkTest/WasmComponentSdkTest/WasmComponentSdkTest.csproj +++ b/test/WasmComponentSdkTest/WasmComponentSdkTest/WasmComponentSdkTest.csproj @@ -33,7 +33,6 @@ - diff --git a/test/WasmComponentSdkTest/testapps/AppWithWitFolder/AppWithWitFolder.csproj b/test/WasmComponentSdkTest/testapps/AppWithWitFolder/AppWithWitFolder.csproj index 938cdcb..f069945 100644 --- a/test/WasmComponentSdkTest/testapps/AppWithWitFolder/AppWithWitFolder.csproj +++ b/test/WasmComponentSdkTest/testapps/AppWithWitFolder/AppWithWitFolder.csproj @@ -15,7 +15,6 @@ - diff --git a/test/WasmComponentSdkTest/testapps/OciWit/OciWit.csproj b/test/WasmComponentSdkTest/testapps/OciWit/OciWit.csproj index 1e315b6..4757792 100644 --- a/test/WasmComponentSdkTest/testapps/OciWit/OciWit.csproj +++ b/test/WasmComponentSdkTest/testapps/OciWit/OciWit.csproj @@ -13,7 +13,6 @@ - diff --git a/test/WasmComponentSdkTest/testapps/SimpleConsumer/SimpleConsumer.csproj b/test/WasmComponentSdkTest/testapps/SimpleConsumer/SimpleConsumer.csproj index de0792a..e520bde 100644 --- a/test/WasmComponentSdkTest/testapps/SimpleConsumer/SimpleConsumer.csproj +++ b/test/WasmComponentSdkTest/testapps/SimpleConsumer/SimpleConsumer.csproj @@ -16,7 +16,6 @@ - diff --git a/test/WasmComponentSdkTest/testapps/SimpleProducer/SimpleProducer.csproj b/test/WasmComponentSdkTest/testapps/SimpleProducer/SimpleProducer.csproj index 89ba5c6..3263e63 100644 --- a/test/WasmComponentSdkTest/testapps/SimpleProducer/SimpleProducer.csproj +++ b/test/WasmComponentSdkTest/testapps/SimpleProducer/SimpleProducer.csproj @@ -16,7 +16,6 @@ - diff --git a/test/WitBindgenTest/testapps/LibraryUsingWit/LibraryUsingWit.csproj b/test/WitBindgenTest/testapps/LibraryUsingWit/LibraryUsingWit.csproj index 1341151..f20042f 100644 --- a/test/WitBindgenTest/testapps/LibraryUsingWit/LibraryUsingWit.csproj +++ b/test/WitBindgenTest/testapps/LibraryUsingWit/LibraryUsingWit.csproj @@ -10,7 +10,6 @@ - diff --git a/test/WitBindgenTest/testapps/LibraryWithCustomGeneratedFilesLocation/LibraryWithCustomGeneratedFilesLocation.csproj b/test/WitBindgenTest/testapps/LibraryWithCustomGeneratedFilesLocation/LibraryWithCustomGeneratedFilesLocation.csproj index 31cb00a..146f6c8 100644 --- a/test/WitBindgenTest/testapps/LibraryWithCustomGeneratedFilesLocation/LibraryWithCustomGeneratedFilesLocation.csproj +++ b/test/WitBindgenTest/testapps/LibraryWithCustomGeneratedFilesLocation/LibraryWithCustomGeneratedFilesLocation.csproj @@ -11,7 +11,6 @@ - diff --git a/test/WitBindgenTest/testapps/LibraryWithExceptions/LibraryWitExceptions.csproj b/test/WitBindgenTest/testapps/LibraryWithExceptions/LibraryWitExceptions.csproj index 2c35d8f..f255ad3 100644 --- a/test/WitBindgenTest/testapps/LibraryWithExceptions/LibraryWitExceptions.csproj +++ b/test/WitBindgenTest/testapps/LibraryWithExceptions/LibraryWitExceptions.csproj @@ -10,7 +10,6 @@ - diff --git a/test/WitBindgenTest/testapps/LibraryWithWitResultType/LibraryWithWitResultType.csproj b/test/WitBindgenTest/testapps/LibraryWithWitResultType/LibraryWithWitResultType.csproj index 9d2aab3..466b521 100644 --- a/test/WitBindgenTest/testapps/LibraryWithWitResultType/LibraryWithWitResultType.csproj +++ b/test/WitBindgenTest/testapps/LibraryWithWitResultType/LibraryWithWitResultType.csproj @@ -11,7 +11,6 @@ - From d92e71601c7b11e5257cc4830f34e5371e21b77f Mon Sep 17 00:00:00 2001 From: Gerard Smit Date: Wed, 17 Sep 2025 00:55:01 +0200 Subject: [PATCH 2/7] Rename WasmComponentSdkVersion to WitBindgenVersion --- src/WasmComponent.Sdk/Version.xml | 4 +--- src/WasmComponent.Sdk/sdk/Sdk.props | 4 ---- src/WasmComponent.Sdk/sdk/Sdk.targets | 4 ++++ 3 files changed, 5 insertions(+), 7 deletions(-) diff --git a/src/WasmComponent.Sdk/Version.xml b/src/WasmComponent.Sdk/Version.xml index 497c28d..ab6d921 100644 --- a/src/WasmComponent.Sdk/Version.xml +++ b/src/WasmComponent.Sdk/Version.xml @@ -1,7 +1,5 @@ - - $version$ + $version$ - \ No newline at end of file diff --git a/src/WasmComponent.Sdk/sdk/Sdk.props b/src/WasmComponent.Sdk/sdk/Sdk.props index fd29aec..ef8e3c3 100644 --- a/src/WasmComponent.Sdk/sdk/Sdk.props +++ b/src/WasmComponent.Sdk/sdk/Sdk.props @@ -2,8 +2,4 @@ - - - - \ No newline at end of file diff --git a/src/WasmComponent.Sdk/sdk/Sdk.targets b/src/WasmComponent.Sdk/sdk/Sdk.targets index b916e31..765d01a 100644 --- a/src/WasmComponent.Sdk/sdk/Sdk.targets +++ b/src/WasmComponent.Sdk/sdk/Sdk.targets @@ -1,4 +1,8 @@ + + + + \ No newline at end of file From d020f43b6acb8c5368aaebe1ebc15a52495f9b84 Mon Sep 17 00:00:00 2001 From: Gerard Smit Date: Wed, 17 Sep 2025 01:08:06 +0200 Subject: [PATCH 3/7] Change SDK style --- .github/workflows/build.yml | 2 +- README.md | 4 ++-- src/WasmComponent.Sdk/sdk/Sdk.props | 1 - src/WasmComponent.Sdk/sdk/Sdk.targets | 1 - templates/wasi-cli.xml | 4 +++- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index f62b5da..194deb0 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -39,7 +39,7 @@ jobs: run: | ls ./artifacts/*.nupkg version=$(unzip -p ./artifacts/*SDK*.nupkg '*.nuspec' | grep -oE "[^<]+" | sed 's///' | grep -oE "^[0-9]+\.[0-9]+\.[0-9]+-preview") - template_version=$(grep -oE 'Sdk="BytecodeAlliance.Componentize.DotNet.Wasm.SDK/[^"]+' ./templates/content/wasi-cli/wasi-cli.csproj | sed 's/Sdk="BytecodeAlliance.Componentize.DotNet.Wasm.SDK\///' | grep -oE "^[0-9]+\.[0-9]+\.[0-9]+-preview") + template_version=$(grep -oE 'Version="[^"]+' ./templates/content/wasi-cli/wasi-cli.csproj | sed 's/Version="//' | grep -oE "^[0-9]+\.[0-9]+\.[0-9]+-preview") echo "Package Version: $version | Template version: $template_version" if [ "$version" != "$template_version" ]; then echo "Version mismatch: Package version ($version) does not match template version ($template_version)"; diff --git a/README.md b/README.md index cebf177..e637994 100644 --- a/README.md +++ b/README.md @@ -267,10 +267,10 @@ Create a `nuget.config` file and add the `dotnet-experimental` package source fo ``` Edit the `.csproj` file: -1. Change the SDK to `BytecodeAlliance.Componentize.DotNet.Wasm.SDK/[VERSION]`, for example: +1. Add the following line under ``: ```xml - + ``` 2. Add the following inside the ``: diff --git a/src/WasmComponent.Sdk/sdk/Sdk.props b/src/WasmComponent.Sdk/sdk/Sdk.props index ef8e3c3..96aa50f 100644 --- a/src/WasmComponent.Sdk/sdk/Sdk.props +++ b/src/WasmComponent.Sdk/sdk/Sdk.props @@ -1,5 +1,4 @@ - \ No newline at end of file diff --git a/src/WasmComponent.Sdk/sdk/Sdk.targets b/src/WasmComponent.Sdk/sdk/Sdk.targets index 765d01a..9498aed 100644 --- a/src/WasmComponent.Sdk/sdk/Sdk.targets +++ b/src/WasmComponent.Sdk/sdk/Sdk.targets @@ -4,5 +4,4 @@ - \ No newline at end of file diff --git a/templates/wasi-cli.xml b/templates/wasi-cli.xml index b854096..685b1db 100644 --- a/templates/wasi-cli.xml +++ b/templates/wasi-cli.xml @@ -1,4 +1,6 @@ - + + + Exe From 796f359d7c5d5897621cca0d096dab78d3a44060 Mon Sep 17 00:00:00 2001 From: Gerard Smit Date: Wed, 17 Sep 2025 12:34:23 +0200 Subject: [PATCH 4/7] Add NuGet source in SDK --- README.md | 22 ++++++++++--------- nuget.config | 10 --------- ...lliance.Componentize.DotNet.Wasm.SDK.props | 6 ++--- ...iance.Componentize.DotNet.Wasm.SDK.targets | 9 ++++++++ templates/content/wasi-cli/nuget.config | 9 -------- 5 files changed, 23 insertions(+), 33 deletions(-) delete mode 100644 nuget.config delete mode 100644 templates/content/wasi-cli/nuget.config diff --git a/README.md b/README.md index e637994..0e973c5 100644 --- a/README.md +++ b/README.md @@ -256,15 +256,6 @@ If you get a build error along the lines of _failed to encode a component from m * `dotnet new console -o MyApp` * `cd MyApp` -Create a `nuget.config` file and add the `dotnet-experimental` package source for the `NativeAOT-LLVM` dependency: - -* `dotnet new nugetconfig` -* Add these keys to `nuget.config` after ``: - -```xml - - -``` Edit the `.csproj` file: 1. Add the following line under ``: @@ -276,7 +267,6 @@ Edit the `.csproj` file: ```xml wasi-wasm - false true true true @@ -304,6 +294,18 @@ Caused by: Some imports automatically imported since they are so common. In this case you should tell the runtime to implement those imports. For instance for the error above, in wasmtime you might add `-S cli` to the `wasmtime serve` command like `wasmtime serve -S cli` to include the `wasi:cli/environment@0.2.0` in wasmtime runtime host implementation. +## SDK configuration +You can configure the SDK by setting properties in your project file. The following are supported: + +| Property Name | Description | Default | +|---------------|-------------|---------| +| `WasiSdkVersion` | Version of the WASI SDK to use.
Beware that not all versions of the WASI SDK are compatible with NativeAOT-LLVM. You'll see an warning if you pick an incompatible version from NativeAOT-LLVM.

⚠️ When changing this value, or the NativeAOT-LLVM version, check the build output for any warnings! | `24.0` | +| `NativeAotLlvmVersion` | Version of the NativeAOT-LLVM package to use.
Find latest versions in the [dotnet-experimental feed](https://dev.azure.com/dnceng/public/_artifacts/feed/dotnet-experimental/NuGet/Microsoft.DotNet.ILCompiler.LLVM/versions). | `10.0.0-alpha.1.25162.1` | +| `WitBindgenVersion` | Version of the `BytecodeAlliance.Componentize.DotNet.WitBindgen` package to use. | Current SDK version | +| `RegisterExperimentalNuGetSource` | Whether to register the [dotnet-experimental feed](https://dev.azure.com/dnceng/public/_artifacts/feed/dotnet-experimental/NuGet) to find the NativeAOT-LLVM package. Set this to `false` if you have a NuGet.config that already includes this feed. | `true` | +| `WitBindgenAddtionalArgs` | Additional arguments to pass to `wit-bindgen` when generating C# bindings. Separate multiple args with spaces. | (empty) | +| `WitGeneratedFilesRoot` | Folder to place generated WIT files. Relative to the project root. | (empty) | + ## Credits This project was original developed and forked from https://github.com/SteveSandersonMS/wasm-component-sdk under the Apache 2.0 License with a LLVM exception. diff --git a/nuget.config b/nuget.config deleted file mode 100644 index d2578df..0000000 --- a/nuget.config +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - - - - - diff --git a/src/WasmComponent.Sdk/build/BytecodeAlliance.Componentize.DotNet.Wasm.SDK.props b/src/WasmComponent.Sdk/build/BytecodeAlliance.Componentize.DotNet.Wasm.SDK.props index 33aaaca..802b3b6 100644 --- a/src/WasmComponent.Sdk/build/BytecodeAlliance.Componentize.DotNet.Wasm.SDK.props +++ b/src/WasmComponent.Sdk/build/BytecodeAlliance.Componentize.DotNet.Wasm.SDK.props @@ -22,10 +22,8 @@ 10.0.0-alpha.1.25162.1 + true
- - - - +
diff --git a/src/WasmComponent.Sdk/build/BytecodeAlliance.Componentize.DotNet.Wasm.SDK.targets b/src/WasmComponent.Sdk/build/BytecodeAlliance.Componentize.DotNet.Wasm.SDK.targets index 06648c7..51caa38 100644 --- a/src/WasmComponent.Sdk/build/BytecodeAlliance.Componentize.DotNet.Wasm.SDK.targets +++ b/src/WasmComponent.Sdk/build/BytecodeAlliance.Componentize.DotNet.Wasm.SDK.targets @@ -1,4 +1,13 @@ + + $(RestoreAdditionalProjectSources);https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-experimental/nuget/v3/index.json; + + + + + + + diff --git a/templates/content/wasi-cli/nuget.config b/templates/content/wasi-cli/nuget.config deleted file mode 100644 index caa4ee8..0000000 --- a/templates/content/wasi-cli/nuget.config +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - - - - From efd939dac71923f778e29cf12fd5045a5848d461 Mon Sep 17 00:00:00 2001 From: Gerard Smit Date: Thu, 18 Sep 2025 13:23:18 +0200 Subject: [PATCH 5/7] Changed README.md --- README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 0e973c5..4a7ad60 100644 --- a/README.md +++ b/README.md @@ -299,12 +299,12 @@ You can configure the SDK by setting properties in your project file. The follow | Property Name | Description | Default | |---------------|-------------|---------| -| `WasiSdkVersion` | Version of the WASI SDK to use.
Beware that not all versions of the WASI SDK are compatible with NativeAOT-LLVM. You'll see an warning if you pick an incompatible version from NativeAOT-LLVM.

⚠️ When changing this value, or the NativeAOT-LLVM version, check the build output for any warnings! | `24.0` | +| `WasiSdkVersion` | Version of the WASI SDK to use.
Be aware that not all versions of the WASI SDK are compatible with NativeAOT-LLVM. A warning will appear if you select an incompatible version for NativeAOT-LLVM.

⚠️ When changing this value, or the NativeAOT-LLVM version, check the build output for a warning! | `24.0` | | `NativeAotLlvmVersion` | Version of the NativeAOT-LLVM package to use.
Find latest versions in the [dotnet-experimental feed](https://dev.azure.com/dnceng/public/_artifacts/feed/dotnet-experimental/NuGet/Microsoft.DotNet.ILCompiler.LLVM/versions). | `10.0.0-alpha.1.25162.1` | | `WitBindgenVersion` | Version of the `BytecodeAlliance.Componentize.DotNet.WitBindgen` package to use. | Current SDK version | | `RegisterExperimentalNuGetSource` | Whether to register the [dotnet-experimental feed](https://dev.azure.com/dnceng/public/_artifacts/feed/dotnet-experimental/NuGet) to find the NativeAOT-LLVM package. Set this to `false` if you have a NuGet.config that already includes this feed. | `true` | -| `WitBindgenAddtionalArgs` | Additional arguments to pass to `wit-bindgen` when generating C# bindings. Separate multiple args with spaces. | (empty) | -| `WitGeneratedFilesRoot` | Folder to place generated WIT files. Relative to the project root. | (empty) | +| `WitBindgenAdditionalArgs` | Additional arguments to pass to `wit-bindgen` when generating C# bindings. Separate multiple arguments with spaces. For example: `--with-wit-results --features tls`. | (empty) | +| `WitGeneratedFilesRoot` | Folder (relative to the project root) where generated WIT files will be placed. | (empty) | ## Credits From 96bc7f0afbc7caee34c23de0c8da3c91a3b3e4fe Mon Sep 17 00:00:00 2001 From: Gerard Smit Date: Thu, 18 Sep 2025 13:24:48 +0200 Subject: [PATCH 6/7] Revert correction: there is a typo in the property name --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 4a7ad60..f7077db 100644 --- a/README.md +++ b/README.md @@ -303,7 +303,7 @@ You can configure the SDK by setting properties in your project file. The follow | `NativeAotLlvmVersion` | Version of the NativeAOT-LLVM package to use.
Find latest versions in the [dotnet-experimental feed](https://dev.azure.com/dnceng/public/_artifacts/feed/dotnet-experimental/NuGet/Microsoft.DotNet.ILCompiler.LLVM/versions). | `10.0.0-alpha.1.25162.1` | | `WitBindgenVersion` | Version of the `BytecodeAlliance.Componentize.DotNet.WitBindgen` package to use. | Current SDK version | | `RegisterExperimentalNuGetSource` | Whether to register the [dotnet-experimental feed](https://dev.azure.com/dnceng/public/_artifacts/feed/dotnet-experimental/NuGet) to find the NativeAOT-LLVM package. Set this to `false` if you have a NuGet.config that already includes this feed. | `true` | -| `WitBindgenAdditionalArgs` | Additional arguments to pass to `wit-bindgen` when generating C# bindings. Separate multiple arguments with spaces. For example: `--with-wit-results --features tls`. | (empty) | +| `WitBindgenAddtionalArgs` | Additional arguments to pass to `wit-bindgen` when generating C# bindings. Separate multiple arguments with spaces. For example: `--with-wit-results --features tls`. | (empty) | | `WitGeneratedFilesRoot` | Folder (relative to the project root) where generated WIT files will be placed. | (empty) | ## Credits From 747c3295ea8a5f1ae4efe048029c0013cc71b868 Mon Sep 17 00:00:00 2001 From: Gerard Smit Date: Thu, 18 Sep 2025 13:51:19 +0200 Subject: [PATCH 7/7] Typo --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index f7077db..c85a98d 100644 --- a/README.md +++ b/README.md @@ -261,7 +261,7 @@ Edit the `.csproj` file: 1. Add the following line under ``: ```xml - + ``` 2. Add the following inside the ``: