加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

c# – ManageUserViewModel类在哪里?

发布时间:2020-12-15 08:38:16 所属栏目:百科 来源:网络整理
导读:我使用ASP.Net MVC 5,EF 6和.Net 4.5.1创建了一个项目 在某些时候,我需要更改项目所在的命名空间,从“MyTestProject”更改为“MyRealProject”. 在整个网站上进行这些更改之后,我现在在几个视图中遇到了一些错误. _ChangePasswordPartial.cshtml再也找不到“
我使用ASP.Net MVC 5,EF 6和.Net 4.5.1创建了一个项目
在某些时候,我需要更改项目所在的命名空间,从“MyTestProject”更改为“MyRealProject”.

在整个网站上进行这些更改之后,我现在在几个视图中遇到了一些错误.
_ChangePasswordPartial.cshtml再也找不到“@model Microsoft.AspNet.Identity.ManageUserViewModel”而且_SetPasswordPartial.cshtml找不到“MyRealProject.ManageUserViewModel”

在项目的哪个位置,我找不到包含类ManageUserViewModel的文件.在我更改命名空间之前,它已找到,但现在却没有.为什么?它去了哪里,我该如何解决?

解决方法

发现它是一个已知的问题:
http://blogs.msdn.com/b/webdev/archive/2014/08/04/announcing-new-web-features-in-visual-studio-2013-update-3-rtm.aspx
  1. When creating a default C# ASP.NET Web Application from MVC,WebAPI or SPA template with individual authentication,generated ViewsAccount _SetPasswordPartial.cshtml and _ChangePasswordPartial.cshtml files contain invalid model.

In file _SetPasswordPartial.cshtml,

@model .Models.ManageUserViewModel
Should be changed to:
@model .Models.SetPasswordViewModel

In file _ChangePasswordPartial.cshtml,

@model Microsoft.AspNet.Identity.ManageUserViewModel
Should be changed to:
@model .Models.ChangePasswordViewModel

Similar problems exist for generated VB projects as well.

In file _SetPasswordPartial.vbhtml,

@ModelType ManageUserViewModel
Should be changed to:
@ModelType SetPasswordViewModel

In file _ChangePasswordPartial.vbhtml,

@ModelType ManageUserViewModel
Should be changed to:
@ModelType ChangePasswordViewModel

也发布在这里:https://stackoverflow.com/a/27687882/1071698.我不知道有重复问题和答案的规则是什么,请根据需要进行编辑.

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读