Skip to content

Conversation

@GerardSmit
Copy link
Contributor

@GerardSmit GerardSmit commented Sep 16, 2025

PoC to drop runtime.$(NETCoreSdkPortableRuntimeIdentifier).microsoft.dotnet.ilcompiler.llvm in the template.

The new template is as following:

  <Project Sdk="Microsoft.NET.Sdk">
  
+   <Sdk Name="BytecodeAlliance.Componentize.DotNet.Wasm.SDK" Version="[VERSION]">

    <PropertyGroup>
      <OutputType>Exe</OutputType>
      <TargetFramework>net10.0</TargetFramework>
      <RootNamespace>wasi_cli</RootNamespace>
      <ImplicitUsings>enable</ImplicitUsings>
      <Nullable>enable</Nullable>
      <InvariantGlobalization>true</InvariantGlobalization>
    </PropertyGroup>

- <ItemGroup>
-   <PackageReference Include="BytecodeAlliance.Componentize.DotNet.Wasm.SDK" Version="0.7.0-preview*" />
-   <PackageReference Include="runtime.$(NETCoreSdkPortableRuntimeIdentifier).microsoft.dotnet.ilcompiler.llvm" Version="10.0.0-alpha.1.25162.1" />
- </ItemGroup>

  </Project>

Important

This would need a minor bump (to 0.8) since it's a breaking change.

<PackageReference Include="Microsoft.DotNet.ILCompiler.LLVM" PrivateAssets="None" />
<ItemGroup>
<PackageReference Include="Microsoft.DotNet.ILCompiler.LLVM" IsImplicitlyDefined="true" Version="$(NativeAotLlvmVersion)" />
<PackageReference Include="runtime.$(NETCoreSdkPortableRuntimeIdentifier).microsoft.dotnet.ilcompiler.llvm" IsImplicitlyDefined="true" Version="$(NativeAotLlvmVersion)" />
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IsImplicitlyDefined is needed because of:

<PropertyGroup>
<ManagePackageVersionsCentrally>true</ManagePackageVersionsCentrally>
</PropertyGroup>

Otherwise, it is complaining that the version is not managed by PackageVersion.

@GerardSmit
Copy link
Contributor Author

I've changed it to <Sdk Name=".." Version=".." /> as 'reflectronic' in Discord mentioned that Aspire does the same:
https://learn.microsoft.com/en-us/dotnet/aspire/fundamentals/dotnet-aspire-sdk#overview

| `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) |
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think there is a typo in property item WitBindgenAddtionalArgs:

<Exec Command="$(WitBindgenExe) c-sharp %(Wit.Identity) %(Wit.WitWorldArg) --runtime $(WitBindgenRuntime) $(WitBindgenAddtionalArgs) --out-dir $(WitGeneratedFilesRoot)" />

Shouldn't this be WitBindgenAdditionalArgs?

@GerardSmit GerardSmit marked this pull request as ready for review September 18, 2025 11:26
@jsturtevant
Copy link
Contributor

This looks like what I was trying to accomplish awhile back! I need to read through https://learn.microsoft.com/en-us/dotnet/core/project-sdk/overview but upon a quick look it seems like this will work.

Are there trade-off of being an SDK version a nuget package? It seems in this case we really are an SDK

@GerardSmit
Copy link
Contributor Author

The biggest downside that I can find is that NuGet doesn't support updating SDK versions (from NuGet).

When a new version comes out, you have to manually update the version.

See NuGet/Home#13127

I'm not sure if Dependabot supports notifications for new SDK versions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants