哪里是类ManageUserViewModel? [英] Where is the class ManageUserViewModel?
问题描述
我已经创建使用ASP.Net MVC 5,6 EF和.Net 4.5.1项目
在某些时候,我需要改变命名空间,该项目是中,从为MyTestProject到MyRealProject。
在整个网站上进行这些更改后,我现在一对夫妇的我的观点得到几个错误。
_ChangePasswordPartial.cshtml找不到@model Microsoft.AspNet.Identity.ManageUserViewModel任何时间更长,_SetPasswordPartial.cshtml找不到MyRealProject.ManageUserViewModel
没有其中该项目可我发现,包含类ManageUserViewModel的文件。之前,我改变了它被发现的命名空间,但现在还不是。为什么?它到哪里去了?我怎么解决?
发现这是一个已知的问题:
<一href=\"http://blogs.msdn.com/b/webdev/archive/2014/08/04/announcing-new-web-features-in-visual-studio-2013-update-3-rtm.aspx\">http://blogs.msdn.com/b/webdev/archive/2014/08/04/announcing-new-web-features-in-visual-studio-2013-update-3-rtm.aspx
<醇开始=2>
创建从MVC,还是的WebAPI个别认证SPA模板默认的C#ASP.NET Web应用程序时,生成的意见\\帐户\\ _SetPasswordPartial.cshtml和_ChangePasswordPartial.cshtml文件包含无效的模式。
在文件_SetPasswordPartial.cshtml,
@model .Models.ManageUserViewModel
应改为:
@model .Models.SetPasswordViewModel
在文件_ChangePasswordPartial.cshtml,
@model Microsoft.AspNet.Identity.ManageUserViewModel
应改为:
@model .Models.ChangePasswordViewModel
有关生成的VB项目也存在类似的问题,以及
在文件_SetPasswordPartial.vbhtml,
@ModelType ManageUserViewModel
应改为:
@ModelType SetPasswordViewModel
在文件_ChangePasswordPartial.vbhtml,
@ModelType ManageUserViewModel
应改为:
@ModelType ChangePasswordViewModel
块引用>还张贴在这里: http://stackoverflow.com/a/27687882/1071698 。我不知道有重复的问题和答案的规则,请根据需要进行编辑。
I have created a project using ASP.Net MVC 5, EF 6 and .Net 4.5.1 At some point I needed to change the namespace that the project is in, from "MyTestProject" to "MyRealProject".
After making those changes throughout the web site I now get several errors in a couple of my views. _ChangePasswordPartial.cshtml can't find "@model Microsoft.AspNet.Identity.ManageUserViewModel" any longer and _SetPasswordPartial.cshtml can't find "MyRealProject.ManageUserViewModel"
No where in the project can I find a file that contains the class ManageUserViewModel. Before I changed the namespace it was found but now it isn't. Why? Where did it go and how do I fix it?
解决方案Found out it's a known problem: http://blogs.msdn.com/b/webdev/archive/2014/08/04/announcing-new-web-features-in-visual-studio-2013-update-3-rtm.aspx
- 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 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
Also posted it here:http://stackoverflow.com/a/27687882/1071698. I don't know what the rules with duplicate questions and answers, please edit as necessary.
这篇关于哪里是类ManageUserViewModel?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!