davidfowl / TodoApi

Todo application with ASP.NET Core Blazor WASM, Minimal APIs and Authentication
MIT License
2.74k stars 411 forks source link

net8 branch doesn't build #84

Open akhanalcs opened 1 year ago

akhanalcs commented 1 year ago

image

F-Persson commented 1 year ago

You may use

builder.Services.AddAuthentication().AddBearerToken(IdentityConstants.BearerScheme);
builder.Services.AddAuthorizationBuilder();

However you might wanna try the new net 8 IdentityEndpoints. Like

builder.Services.AddAuthentication();
builder.Services.AddAuthorizationBuilder();

builder.Services.AddIdentityApiEndpoints<TodoUser>()
                .AddRoles<IdentityRole>()
                .AddEntityFrameworkStores<AppDbContext>();

The AddIdentityApiEndpoints will add the AddBearerToken(IdentityConstants.BearerScheme) aswell

davidfowl commented 1 year ago

Fixed.

akhanalcs commented 1 year ago

@davidfowl It doesn't look fixed though.

4>Program.cs(13,1): Error CS7069 : Reference to type 'IRazorComponentsBuilder' claims it is defined in 'Microsoft.AspNetCore.Components.Endpoints', but it could not be found

Just synced the project and tried it again:

image
F-Persson commented 1 year ago

The Net8 branch works for me. I'm using 8.0.100-rc.1.23455.8 on Win11

akhanalcs commented 1 year ago

I'm getting this error after updating the SDK to latest version:

image

These are my sdks:

image
akhanalcs commented 12 months ago

Hi @davidfowl, I can make this error go away:

image

With this change:

image image

No error:

image

Do you recommend it?