I am a novice programmer, learning as I work on my first code project. I started with MVC 4 and managed to get CRUD working for a single entity. I decided to try to tackle security next. When Visual Studio scaffolded my MVC 4 project, it added an account model, views, and controller. I have since upgraded my project to MVC 5 and EF 6 using the procedure described here. I now want to replace the MVC 4 security code with MVC 5 scaffolded Identity model, view, controller. Is this possible? If so, how?
Open a new project in Visual Studio and select Visual C#. In Visual C#, select ASP.NET Web Application and give the project name. Click OK. Step 2: Select MVC template from template type and click Change Authentication button.
Ironically, I was just dealing with this issue a few nights ago...
I would suggest just going to an entirely new MVC 5 application. That being said, I'm not sure how far your application is in development.
What are you using for security right now? I'm going to assume SimpleMembership? If you did, there's a really nice article/project by @Kevin Junghans that involves decoupling simplemembership from your application.
You could theoretically, using that, get away with decoupling simplemembership, then using the answer found here add in identity.
My experience led me to redo-ing it, but again, I'm not sure how far you are in development, so I don't know if that is a viable option or not. If it is, I would just suggest that, and adding in your controllers as you go.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With