Where is the class ManageUserViewModel?

大兔子大兔子 提交于 2019-12-05 07:11:32
Ronen Festinger

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

  1. 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:https://stackoverflow.com/a/27687882/1071698. I don't know what the rules with duplicate questions and answers, please edit as necessary.

bendyourtaxes

_ChangePasswordPartial.cshtml should use something like

@model MyRealProject.Models.SetPasswordViewModel

Then make sure in the models folder AccountViewModels.cs

The namespace is updated to MyRealProject.

Hope that helps.

CRTL + SHIFT + F , then type in "class ManageUserViewModel" , just that simple

make sure it is set to search entire solution , and it will find the class you are looking for

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!