dotnet / aspire

An opinionated, cloud ready stack for building observable, production ready, distributed applications in .NET
https://learn.microsoft.com/dotnet/aspire
MIT License
3.71k stars 423 forks source link

Blazor Aspire MS Identity combination #3552

Open Allann opened 5 months ago

Allann commented 5 months ago

Hi all,

Just a general question, maybe not directly related to Aspire, but is the following combination not valid?

Reasons for asking:

  1. MS Identity Web not available in the drop down for this Web App configuration. How then can I add MS Identity as I need to use Entra ID
  2. Adding Aspire orchestration starts me with just a blank solution, I manually have to add each project.
  3. When adding Aspire orchestration on the BlazorApp it shows a dialog "The .NET Aspire orchestrator project BlazorApp1.AppHost is up to date". But no changes were made to either the blazor app nor the appHost projects. image
  4. If I manually add a reference from the AppHost to the project, it recognises the project, allowing the lines
    
    var builder = DistributedApplication.CreateBuilder(args);

var cache = builder.AddRedis("cache");

var apiService = builder.AddProject("webapi1");

builder.AddProject("blazorfrontend") .WithReference(cache) .WithReference(apiService);

builder.Build().Run();

5. when I then add the reference from BlazorApp1 to BlazorApp1.ServiceDefaults I received the following error:

Error NETSDK1082 There was no runtime pack for Microsoft.AspNetCore.App available for the specified RuntimeIdentifier 'browser-wasm'. BlazorApp1 C:\Program Files\dotnet\sdk\8.0.204\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.Sdk.FrameworkReferenceResolution.targets 491



As eShop doesn't use Blazor I assume these issues have gone unnoticed and hence this question.  I have also included the solution where these questions came from (basically dotnet new code)

[BlazorApp1.zip](https://github.com/dotnet/aspire/files/14928687/BlazorApp1.zip)
davidfowl commented 5 months ago

What version of visual studio are you using?

Allann commented 5 months ago

i had just upgraded to VS 2022 17.10.0 Preview 3.

Final goal was to create a POC for a Blazor Web App, using 2 webapi where requests are authenticated via Entra ID (azure ad) and use OBO flow. but not having much luck with any of the steps.

davidfowl commented 2 weeks ago

Does thiis still repro?

SujitGur12345 commented 5 days ago

I Have Aspire Blazor Project Running I want To Setup All Idenity Pages i am using Scaffolding But it Does not Creates Pages and runs in a issue given below.

image (2) That Says value as null for Parameter name : projectRelativePath. Can someone please Guide me into this???