Skip to content

Error when running in Visual Studio #76

Description

@HowardvanRooijen

With the following csproj file:

<ItemGroup>
    <PackageReference Include="BytecodeAlliance.Componentize.DotNet.Wasm.SDK" Version="0.5.0-preview00008" />
    <!--Windows -->
    <PackageReference Include="runtime.win-x64.microsoft.dotnet.ilcompiler.llvm" Version="10.0.0-alpha.1.25118.1" />
</ItemGroup>

I can build using dotnet build at the command line (or terminal in VS Code), but in Visual Studio, I get the following error:

Failed to restore C:\repo\componentize-dotnet-demo\componentize-dotnet-demo\Ais.Net.Receiver.Host.Wasi\Ais.Net.Receiver.Host.Wasi.csproj (in 781 ms).
NuGet package restore failed. Please see Error List window for detailed warnings and errors.
1>C:\Program Files\dotnet\sdk\9.0.200\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.RuntimeIdentifierInference.targets(237,5): error NETSDK1067: Self-contained applications are required to use the application host. Either set SelfContained to false or set UseAppHost to true.
1>Done building project "Ais.Net.Receiver.Host.Wasi.csproj" -- FAILED.

But if I add the following package in, it builds fine in Visual Studio:

<ItemGroup>
    <!-- Added -->
    <PackageReference Update="Microsoft.DotNet.ILCompiler.LLVM" Version="10.0.0-alpha.1.25118.1" />
    <PackageReference Include="BytecodeAlliance.Componentize.DotNet.Wasm.SDK" Version="0.5.0-preview00008" />
    <!--Windows -->
    <PackageReference Include="runtime.win-x64.microsoft.dotnet.ilcompiler.llvm" Version="10.0.0-alpha.1.25118.1" />
</ItemGroup>

Activity

  1. jsturtevant commented on Mar 10, 2025

    @jsturtevant
    Contributor

    Thanks, I don't often use Visual Studio anymore, I will have to get this set up to try it out. The BytecodeAlliance.Componentize.DotNet.Wasm.SDK should be adding the package reference to Microsoft.DotNet.ILCompiler.LLVM, not sure why its not working in VS but does work in VScode.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions