Wondering if anyone else has experienced this and what their solution was if so. In Visual Studio 2013 I create a new ASP.NET Web Application, leaving all the defaults as they are
In the next screen I pick MVC, adding folders and core references for MVC but not the other two options. Authentication is left at Individual User Accounts and I've unchecked the Host in the cloud option, as shown below.
The project wizard completes and I can see that there are 26 errors in it before I do anything else.
The first fix that removes a bunch of these errors is that the Views\Account\ _SetPasswordPartial.cshtml
and _ChangePasswordPartial.cshtml
files contain invalid models so I change those as follows:
[My project name here is WebApplication1, substitute your own value]
In _SetPasswordPartial.cshtml:
From @model WebApplication1.Models.ManageUserViewModel
to @model WebApplication1.Models.SetPasswordViewModel
In file _ChangePasswordPartial.cshtml: From @model Microsoft.AspNet.Identity.ManageUserViewModel to @model WebApplication1.Models.ChangePasswordViewModel
That drops me down to 4 errors, spread across 4 files
1. Line 68, ManageController.cs
return View(linkedAccounts);
The view RemoveLogin doesn't exist
2,3.
There are two errors _SetPasswordPartial.cshtml
and _ChangePasswordPartial.cshtml
complaining about not being able to resolve the Manage action but when I debug and visit those URLs in the browser they work fine so I suspect they're in a route table somewhere. I have R# installed so sometimes that can be wrong if that's the case.
4.
The last one is that the _RemoveAccountPartial.cshtml
has an error on line 15 where it complains about not having a Disassociate action in the Account controller, as far as I can ascertain this is to do with removing other authentication providers to the application.
Now I can fix all these by adding the required code but it just doesn't sit well with me that the templates don't work well out of the box. Are there fresh templates available or has anyone done the canonical write-up on how to get your template humming before you commence work properly on it?
EDIT 2014-11-13 I've just applied VS2013.4 and these issues appear to be fixed as part of it. If this is an issue for people then I suggest applying that update.
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
I do not know what is the root cause of these problems but after playing with the project the following seems to bring it to a consistent state:
Views\Account\_SetPasswordPartial.cshtml
Views\Account\_ChangePasswordPartial.cshtml
Views\Account\_RemoveAccountPartial.cshtml
All these have counterparts under the
Manage
controller. And finally:RemoveLogin()
action method fromManageController
. Make sure you only remove the GET method (lines 64 - 69), as the POST one is actually used. The list of logins is rendered byManageLogins
action.I confirmed issue also in VS2013 Ultimate Update#3. Submitted bug report to Microsoft Connect under Visual Studio and .NET Framework section.