Stream: C#/.net-collaboration

Topic: Trying to get componentize-dotnet to work on my machine


view this post on Zulip jonas echterhoff (Mar 20 2025 at 09:15):

Hi. I'm trying to use componentize-dotnet to get a working ilc setup to target wasm on my mac. Given the instructions on https://github.com/bytecodealliance/componentize-dotnet , I run into some issues.

The first is this one, and seems to be known: https://github.com/bytecodealliance/componentize-dotnet/issues/80

But before I updated to the latest dotnet version (which caused that issue), I had another issue. And when I try buiding to browser-wasm, I still get that issue. Ilc compilation seems to fail with

Restore complete (0.2s)

  MyApp failed with 1 error(s) (0.2s)  bin/Release/net9.0/browser-wasm/MyApp.dll

    /Users/jechter/.nuget/packages/microsoft.dotnet.ilcompiler.llvm/10.0.0-alpha.1.24573.1/build/Microsoft.NETCore.Native.targets(363,5): error MSB3073: The command ""\tools\\ilc" @"obj/Release/net9.0/browser-wasm/native/MyApp.ilc.rsp"" exited with code 127.

Build failed with 1 error(s) in 0.6s

I noticed that the template adds a package
<PackageReference Include="runtime.linux-x64.microsoft.dotnet.ilcompiler.llvm" Version="10.0.0-alpha.1.25118.1" />

Is the problem that I'm on a mac, and not on linux-x64? I get the same error on a linux VM (but on that VM, I am still on arm64).

Tooling for creating WebAssembly components from C# - bytecodealliance/componentize-dotnet
I've just come back to my demo after a week, and all of a sudden nothing builds. I get the following error: C:\Program Files\dotnet\sdk-manifests\9.0.100\microsoft.net.workload.mono.toolchain.curre...

view this post on Zulip Scott Waye (Mar 20 2025 at 15:01):

Hi, unfortunately we've not had the resource to get MacOS packages built.

view this post on Zulip Scott Waye (Mar 20 2025 at 15:04):

You can encourage MS to do MacOS and/or Arm64 at https://github.com/dotnet/runtimelab/issues/2119

When trying to publish the Hello World project (https://github.com/dotnet/runtimelab/tree/feature/NativeAOT-LLVM/samples/HelloWorld) for WebAssembly target on my Apple MBP M1 Max, with this command...

view this post on Zulip jonas echterhoff (Mar 20 2025 at 15:07):

Thanks - so my problem is likely indeed that there are no packages for my machine. I tried building ilc myself, but struggled to do so because of some llvm header issues (possibly system llvm mixing up with the llvm required for ilc). Will try to get ahold of an x64 linux machine to try it there.

view this post on Zulip Malik Ahmed (Apr 21 2025 at 22:35):

@jonas echterhoff did you have any luck trying to get this to work on an M1 Mac? I've been trying to do this via Docker (using colibra to run an x86_64 vm), but I'm also getting the same error and it makes me wonder if I'm missing a step somewhere...

view this post on Zulip jonas echterhoff (Apr 22 2025 at 05:53):

I did not. I’m currently running a Linux VM to get around this, but would love
a working native macOS solution.

view this post on Zulip Scott Waye (Apr 30 2025 at 16:03):

You can upvote the issue https://github.com/dotnet/runtimelab/issues/2119 although I don't know of anyone who has the time to work on it currently.

When trying to publish the Hello World project (https://github.com/dotnet/runtimelab/tree/feature/NativeAOT-LLVM/samples/HelloWorld) for WebAssembly target on my Apple MBP M1 Max, with this command...

view this post on Zulip Ray Fish (Jun 21 2025 at 20:51):

I'm trying to convert a dll to a wasi component. I've converted dll->wasm successfully with compentize, but I can't get the wasi exports to work; wasm-tools does not list them. Is there a sample proj out there?

view this post on Zulip James Sturtevant (Jun 21 2025 at 21:28):

There is a small sample in the repo as well as lots of examples under the tests folder

https://github.com/bytecodealliance/componentize-dotnet/tree/main/samples/calculator

Tooling for creating WebAssembly components from C# - bytecodealliance/componentize-dotnet

view this post on Zulip Ray Fish (Jun 21 2025 at 22:53):

Now having trouble with wasi host app. I get this exception:

..\ATK.Wasm.Host\ATK.Wasm.Host.csproj : warning NU1603: WasmComponent.Sdk 0.1.0-preview00026 depends on Microsoft.DotNet.ILCompiler.LLVM (>= 8.0.0-preview.7.23503.1) but Microsoft.DotNet.ILCompiler.LLVM 8.0.0-preview.7.23503.1 was not found. Microsoft.DotNet.ILCompiler.LLVM 10.0.0-alpha.1.25162.1 was resolved instead.
Unhandled exception. System.DllNotFoundException: Unable to load DLL '*' or one of its dependencies: The specified module could not be found. (0x8007007E)
   at wit_hostapp.Wit.imports.icuwasi.api.Operations.OperationsInterop.AddInterop.wasmImportAdd(Int32 p0, Int32 p1)
   at wit_hostapp.Wit.imports.icuwasi.api.Operations.OperationsInterop.Add(Int32 left, Int32 right) in ..\ATK.Wasm.Host\obj\Debug\net10.0\wit_bindgen\Wit.imports.icuwasi.api.OperationsInterop.cs:line 20
   at Program.<Main>$(String[] args) in ..\ATK.Wasm.Host\Program.cs:line 5

view this post on Zulip Ray Fish (Jun 22 2025 at 22:57):

got node.js to host my wasi component using jco transpile but I can't get a c# dll to host the component...

view this post on Zulip James Sturtevant (Jun 23 2025 at 17:28):

@Ray Fish when you say you can't get c# to host the component, do you mean you want to run the component in a .net app?

view this post on Zulip Ray Fish (Jun 23 2025 at 21:01):

yeah, I'd like to call the component from a .net console app

view this post on Zulip Ray Fish (Jun 23 2025 at 21:09):

Ultimately, I'd like to create a dll with a wasi interface so that it can be called from many languages.

view this post on Zulip Ray Fish (Jun 23 2025 at 21:31):

--even other .net languages

view this post on Zulip James Sturtevant (Jun 23 2025 at 22:24):

wasmtime-dotnet would be the project for that, it doesn't have support for components since it relies on the c api for wasmtime which doesn't support the component model. https://github.com/bytecodealliance/wasmtime-dotnet/issues/324. the C-api for wasmtime is actively being worked on now so this could be added once thats a bit further along

Context https://github.com/bytecodealliance/wasmtime/tree/main/examples/component Add support for making the same example from C#. https://github.com/WebAssembly/component-model/tree/main https://g...

Last updated: Dec 13 2025 at 20:04 UTC