更新到asp.net Core 2.1后无法访问资源

时间:2018-07-08 15:41:35

标签: c# asp.net-core asp.net-core-identity asp.net-core-2.1

从asp.net core 2.0更新到2.1之后,我无法再构建解决方案了。我不断收到类似的错误

CS0117  'Views_Account_Login' does not contain a definition for 'LoginButton'

对于更新,我已按照here中的说明进行操作。

以前效果很好。同样,在打开提到的视图时,没有显示错误,并且资源上的提到的属性确实存在。

我尝试清理/重建,检查了我所有的资源是否确实生成,等等,但是到目前为止没有成功。

也许有人曾经遇到过这个问题?

更新

services.AddLocalization(options => options.ResourcesPath = "Resources");
services.AddMvc(config =>
{
    var policy = new AuthorizationPolicyBuilder()
         .RequireAuthenticatedUser()
         .Build();
    config.Filters.Add(new AuthorizeFilter(policy));
})
.AddViewLocalization(LanguageViewLocationExpanderFormat.Suffix, opts => opts.ResourcesPath = "Resources")
.AddDataAnnotationsLocalization();

0 个答案:

没有答案