Код: Выделить всё
{
"$schema": "https://json.schemastore.org/launchsettings.json",
"profiles": {
"http": {
"commandName": "Project",
"dotnetRunMessages": true,
"launchBrowser": true,
"hotReloadEnabled": true,
"launchUrl": "account/login",
"applicationUrl": "http://localhost:5113",
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
}
},
"https": {
"commandName": "Project",
"dotnetRunMessages": true,
"launchBrowser": true,
"hotReloadEnabled": true,
"launchUrl": "account/login",
"applicationUrl": "https://localhost:7233;http://localhost:5113",
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
}
}
}
}
Код: Выделить всё
Код: Выделить всё
using MyProject.Components;
using Microsoft.EntityFrameworkCore;
using MyProject.Data.SQLite;
using MyProject.Data.SQLServer;
using MyProject.Components.Account;
using Microsoft.AspNetCore.Components.Authorization;
using Microsoft.AspNetCore.Identity;
using MyProject.Data.SQLiteAuth;
var builder = WebApplication.CreateBuilder(args);
builder.Services.AddDbContextFactory(options =>
options.UseSqlServer(builder.Configuration.GetConnectionString("SQLServerContext") ?? throw new InvalidOperationException("Connection string 'SQLServerContext' not found.")));
builder.Services.AddDbContextFactory(options =>
options.UseSqlite(builder.Configuration.GetConnectionString("SqliteAuthContext") ?? throw new InvalidOperationException("Connection string 'SqliteAuthContext' not found.")));
builder.Services.AddQuickGridEntityFrameworkAdapter();
builder.Services.AddDatabaseDeveloperPageExceptionFilter();
// Add services to the container.
builder.Services.AddRazorComponents()
.AddInteractiveServerComponents()
.AddInteractiveWebAssemblyComponents();
builder.Services.AddCascadingAuthenticationState();
builder.Services.AddScoped();
builder.Services.AddScoped();
builder.Services.AddScoped();
builder.Services.AddAuthentication(options =>
{
options.DefaultScheme = IdentityConstants.ApplicationScheme;
options.DefaultSignInScheme = IdentityConstants.ExternalScheme;
})
.AddIdentityCookies();
builder.Services.AddIdentityCore(options => options.SignIn.RequireConfirmedAccount = true)
.AddEntityFrameworkStores()
.AddSignInManager()
.AddDefaultTokenProviders();
builder.Services.AddSingleton();
var app = builder.Build();
// Configure the HTTP request pipeline.
if (!app.Environment.IsDevelopment())
{
app.UseExceptionHandler("/Error", createScopeForErrors: true);
// The default HSTS value is 30 days. You may want to change this for production scenarios, see https://aka.ms/aspnetcore-hsts.
app.UseHsts();
app.UseMigrationsEndPoint();
}
app.UseHttpsRedirection();
app.UseAntiforgery();
app.MapStaticAssets();
app.MapRazorComponents()
.AddInteractiveServerRenderMode()
.AddInteractiveWebAssemblyRenderMode();
app.MapAdditionalIdentityEndpoints();
app.Run();
Код: Выделить всё
account/loginЭта страница Localhost не может быть найдена
http error 404
Чтобы быть более конкретным, я хочу запустить url {domain}: {{wort}/accloade clide}/> work/wormin}: {{wort}/rackn}/> непосредственно из IIS Manager:
, к сожалению, я не мог получить то, что хотел.
Подробнее здесь: https://stackoverflow.com/questions/797 ... -using-iis
Мобильная версия