Skip to content

Enlisting a Blazor WebAssembly Standalone App in a .NET Aspire orchestration doesn't add the app to the AppHost #8486

Open

Description

@danroth27

Is there an existing issue for this?

  • I have searched the existing issues

Describe the bug

I created a Blazor WebAssembly Standalone App in VS 17.13.5 targeting .NET 9 and selected the project template option to enlist it in a .NET Aspire orchestration. The generated solution contained the standalone Blazor WebAssembly app, the AppHost project, and the ServiceDefaults project. However, it didn't add the Blazor WebAssembly app to the app host. If I manually add the project reference to the Blazor WebAssembly project and add builder.AddProject<BlazorApp4>("client"); to the AppHost project, it seems to work fine.

Expected Behavior

I assume the Blazor WebAssembly app should be added to the AppHost so that when you run the AppHost project the Blazor WebAssembly app also starts and shows up in the Aspire dashboard.

Steps To Reproduce

  • Create a Blazor WebAssembly Standalone App project, selecting the option to Enlist in a .NET Aspire orchestration.

Exceptions (if any)

None

.NET Version info

9.0.201

Anything else?

Nope

Activity

  1. DamianEdwards commented on Apr 1, 2025

    @DamianEdwards
    Member
  2. orlandommb commented on Apr 30, 2025

    @orlandommb

    👀

  3. webprofusion-chrisc commented on May 16, 2025

    @webprofusion-chrisc

    Also looking for a way to do this, our Blazor WASM app calls a separate API (which is already in an aspire host) and it would be good to add the WASM app into the aspire host to see the full trace from app from API to the other parts of the backend.

    Actually configuring the WASM app via aspire would have it's challenges (like rewriting the wwwroot\appsettings.json so the httpclient in the app can point to the aspire hosted API dynamically as @RichardReukemaOptimus states).

    For me this is driven by wanting to see end to end tracing, logging and metric when I fire up the app.

  4. Trapulo commented on Sep 15, 2025

    @Trapulo

    I experienced same problem with a new Blazor WASM standalone + Aspire apphost. Solved adding references to WASM project in AppHost app manually

  5. DamianEdwards commented on Sep 16, 2025

    @DamianEdwards
    Member
  6. danroth27 commented on Sep 16, 2025

    @danroth27
    MemberAuthor

    This still seems to reproduce with VS2022:

    Image
  7. barruka commented on Nov 10, 2025

    @barruka

    Daniel Roth (@danroth27) Aspire is growing significantly, which is great for the project, but with no offense intended, perhaps more time should be dedicated to fixing certain bugs that have been acknowledged for several months, such as all those related to blazor-wasm:

    https://github.com/dotnet/aspire/issues?q=is%3Aissue%20state%3Aopen%20label%3Ablazor-wasm

    Obviously, no one is asking that all ongoing development be stopped the moment a bug is detected to fix it, but most of the blazor-wasm related bugs have been reported for several months now, and we still don't have a solution... :(

  8. danroth27 commented on Nov 10, 2025

    @danroth27
    MemberAuthor

    barruka Agreed! Improving the Blazor WebAssembly experience in .NET Aspire is an area that we're now actively investigating.

  9. mguinness commented on Dec 13, 2025

    @mguinness

    Daniel Roth (@danroth27) Have you seen issue #7524? It's a proposal for service discovery to work in a hosted Blazor WebAssembly project.

  10. danroth27 commented on Dec 17, 2025

    @danroth27
    MemberAuthor

    @danroth27 Have you seen issue #7524? It's a proposal for service discovery to work in a hosted Blazor WebAssembly project.

    Thanks for the pointer! Yup, we're exploring similar ideas in our own prototyping efforts.

  11. fingers10 commented on Feb 2, 2026

    @fingers10

    Daniel Roth (@danroth27) I have an identity server project - IDP.csproj, api project - PublicAPI.csproj and a blazor wasm standlone app - Web.csproj. All running in .net10 in macOS. Here is my aspire setup

    var builder = DistributedApplication.CreateBuilder(args);
    
    var IdpDb = builder.AddPostgres("IDP-Postgres")
            .AddDatabase("IdentityConnectionString", "Identity");
    
    var ApiDb = builder.AddPostgres("API-Postgres")
            .AddDatabase("CommandsConnectionString", "Data");
    
    var Idp = builder.AddProject<Projects.IDP>("IDP")
            .WithReference(IdpDb)
            .WithReference(ApiDb);
    
    var IdpUrl = Idp.GetEndpoint("https");
    
    var Api = builder.AddProject<Projects.PublicAPI>("API")
            .WithReference(ApiDb);
    
    var ApiUrl = Api.GetEndpoint("https");
    
    var Web = builder.AddProject<Projects.Web>("Web")
            .WithEnvironment("ApiBaseAddress", ApiUrl)
            .WithEnvironment("OidcConfiguration__Authority", IdpUrl);
    
    var WebUrl = Web.GetEndpoint("https");
    
    Web
            .WithEnvironment("OidcConfiguration__RedirectUri", $"{WebUrl}/authentication/login-callback")
            .WithEnvironment("OidcConfiguration__PostLogoutRedirectUri", $"{WebUrl}/authentication/logout-callback");
    
    Api
            .WithEnvironment("IDPUrl", IdpUrl)
            .WithEnvironment("WebClient", WebUrl);
    
    Idp
            .WithEnvironment("APIClient", ApiUrl)
            .WithEnvironment("WebClient", WebUrl);
            
    await builder.Build().RunAsync();
    Image

    When I look at the dashboard, I see Web is always Finished state. When I look at the logs for Web, I see

    Executing command 'resource-start'.
    Successfully executed command 'resource-start'.
    A fatal error was encountered. The library 'libhostpolicy.dylib' required to execute the application was not found in '/Users/xxxx/Projects/Personal/xxxx/Web/bin/Debug/net10.0/'.
    Failed to run as a self-contained app.
      - The application was run as a self-contained app because '/Users/xxxx/Projects/Personal/xxxx/Web/bin/Debug/net10.0/Web.runtimeconfig.json' did not specify a framework.
      - If this should be a framework-dependent app, specify the appropriate framework in '/Users/xxxx/Projects/Personal/xxxx/Web/bin/Debug/net10.0/Web.runtimeconfig.json'.
    

    I noticed a similar issue here - #13989

    Please assist me on what I'm missing in my blazor wasm standalone app - Web.csproj

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

Metadata

Metadata

Type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions