我有一个现有的ApplicationUser,我想修改登录的UI页面。所以这就是我决定进行脚手架手术的原因。
应用程序用户.cs
public class ApplicationUser : IdentityUser
{
public List<Student> Students { get; set; }
}但是当我使用最后一个CLI命令时:
dotnet aspnet-codegenerator identity --files="Account.Login;"
我无法运行我的网络应用程序,这是它在网络上显示的内容:

然后,这是日志中出现的错误:
未处理的异常:System.InvalidOperationException:方案已存在:Identity.Application位于Microsoft.AspNetCore.Authentication.AuthenticationOptions.AddScheme(字符串名称,Action
1 configureBuilder) at Microsoft.AspNetCore.Authentication.AuthenticationBuilder.<>c__DisplayClass4_02.b__0(AuthenticationOptions o)位于Microsoft.Extensions.Options.ConfigureNamedOptions1.Configure(String name, TOptions options) at Microsoft.Extensions.Options.OptionsFactory1.Create(字符串名称)
位于Microsoft.Extensions.Options.OptionsManager1.<>c__DisplayClass5_0.<Get>b__0() at System.Lazy1.ViaFactory(LazyThreadSafetyMode模式)位于System.Lazy1.ExecutionAndPublication(LazyHelper executionAndPublication, Boolean useDefaultConstructor) at System.Lazy1.CreateValue( ) 在 Microsoft.Extensions.Options.OptionsCache1.GetOrAdd(String name, Func1 createOptions) 在 Microsoft.Extensions.Options.OptionsManager1.Get(String name) at Microsoft.Extensions.Options.OptionsManager1.get_Value() 在 Microsoft.AspNetCore.Authentication.AuthenticationSchemeProvider..ctor(IOptions1 options, IDictionary2 个方案)位于 Microsoft.AspNetCore.Authentication.AuthenticationSchemeProvider..ctor(IOptions1 options)
PIPIONE
LEATH
随时随地看视频慕课网APP
相关分类