Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Where is the class ManageUserViewModel?

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?

like image 429
John S Avatar asked Nov 10 '14 17:11

John S


1 Answers

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.

like image 198
Ronen Festinger Avatar answered Sep 18 '22 22:09

Ronen Festinger