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).
Hi, unfortunately we've not had the resource to get MacOS packages built.
You can encourage MS to do MacOS and/or Arm64 at https://github.com/dotnet/runtimelab/issues/2119
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.
@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...
I did not. I’m currently running a Linux VM to get around this, but would love
a working native macOS solution.
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.
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?
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
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
got node.js to host my wasi component using jco transpile but I can't get a c# dll to host the component...
@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?
yeah, I'd like to call the component from a .net console app
Ultimately, I'd like to create a dll with a wasi interface so that it can be called from many languages.
--even other .net languages
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
Last updated: Dec 13 2025 at 20:04 UTC