我正在使用.NET Core 3.0.100; Microsoft Visual Studio Community 2019预览版本16.4.0预览版1.0; Blazor服务器(官方发行版)。
我正在尝试将身份验证和授权添加到我的Blazor服务器Web应用程序中。我在这里阅读指南https://docs.microsoft.com/en-us/aspnet/core/security/authentication/scaffold-identity?view=aspnetcore-3.0&tabs=visual-studio#scaffold-identity-into-an-empty-project
(我也读过https://github.com/aspnet/Identity/issues/1825)
然后我右键单击Project,选择Add
\ New Scaffolded Item...
然后
我阅读了文件ScaffoldingReadme.txt
,然后按照指南进行操作。
我按F5进行调试,发现错误
Severity: Error
Error Code: CS0246
Description: The type or namespace name 'IWebHostEnvironment' could not be found (are you missing a using directive or an assembly reference?)
Project: acc133blazor
File: C:\Users\donhuvy\Desktop\acc133b3\acc133blazor\obj\Debug\netcoreapp3.0\Razor\Pages\Shared\_Layout.cshtml.g.cs
Line: 455
Suppression State: Active
这是_Layout.cshtml.g.cs
https://gist.github.com/donhuvy/6754843e62cd08c6bf5b2ef8f326b5f1的内容>
因为文件\obj\Debug\netcoreapp3.0\Razor\Pages\Shared\_Layout.cshtml.g.cs
位于Razor类库Microsoft.AspNetCore.Identity.UI (3.0.0)
中,所以我无法对其进行编辑。
如何解决?
我正在使用.NET Core 3.0.100; Microsoft Visual Studio Community 2019预览版本16.4.0预览版1.0; Blazor服务器(官方发行版)。我试图将身份验证和授权添加到我的...
这是一个问题,
我启动了新项目,并选中了用于身份验证的复选框,它可以正常工作,在创建项目之后稍后将身份验证页面设置为脚手架似乎有此问题。