问题描述
我有一个已获得授权的 MVC 应用程序。一切正常,但按照脚手架标识的文档,我收到以下错误:
~/obj/Debug/net5.0/Razor/Templates/Identity/Pages/_ValidationScriptsPartial.cshtml.g.cs(36,135): 错误 CS0103:名称“StartTagHelperWritingScope”不存在于 当前上下文
“EndTagHelperWritingScope”和“CreateTagHelper”重复出现此错误 目标框架是 .NET 5.0,我的包引用 5.0.1,在 Ubuntu 20.04LTS 机器上。
请帮忙。我在网络搜索的任何地方都找不到这个错误。 我的模板/身份/页面/_ViewImports.cshtml:
@inherits Microsoft.VisualStudio.Web.CodeGeneration.Templating.RazorTemplateBase @@using Microsoft.AspNetCore.Identity @@using @(Model.Namespace).Areas.Identity @@using @(Model.Namespace).Areas.Identity.Pages @@addTagHelper *,Microsoft.AspNetCore.Mvc.TagHelpers @{ if (!string.IsNullOrEmpty(Model.UserClassNamespace) && Model.UserClassNamespace != "Microsoft.AspNetCore.Identity") { @:@@using @(Model.UserClassNamespace) } }
我还通过使用名为 ApplicationUser 的类扩展 IdentityUser 类来添加自定义用户字段。
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)