在整个网站上进行这些更改之后,我现在在几个视图中遇到了一些错误.@H_403_2@_ChangePasswordPartial.cshtml再也找不到“@model Microsoft.AspNet.Identity.ManageUserviewmodel”而且_SetPasswordPartial.cshtml找不到“MyRealProject.ManageUserviewmodel”
在项目的哪个位置,我找不到包含类ManageUserviewmodel的文件.在我更改命名空间之前,它已找到,但现在却没有.为什么?它去了哪里,我该如何解决?
解决方法
- When creating a default C# ASP.NET Web Application from MVC,WebAPI or SPA template with individual authentication,generated Views\Account\ _SetPasswordPartial.cshtml and _ChangePasswordPartial.cshtml files contain invalid model.
In file _SetPasswordPartial.cshtml,
@model .Models.ManageUserviewmodel@H_403_2@ Should be changed to:@H_403_2@ @model .Models.SetPasswordviewmodel
In file _ChangePasswordPartial.cshtml,
@model Microsoft.AspNet.Identity.ManageUserviewmodel@H_403_2@ Should be changed to:@H_403_2@ @model .Models.ChangePasswordviewmodel
Similar problems exist for generated VB projects as well.
In file _SetPasswordPartial.vbhtml,
@ModelType ManageUserviewmodel@H_403_2@ Should be changed to:@H_403_2@ @ModelType SetPasswordviewmodel
In file _ChangePasswordPartial.vbhtml,
@ModelType ManageUserviewmodel@H_403_2@ Should be changed to:@H_403_2@ @ModelType ChangePasswordviewmodel
也发布在这里:https://stackoverflow.com/a/27687882/1071698.我不知道有重复问题和答案的规则是什么,请根据需要进行编辑.