Convert MVC 2 ASPX into MVC 4 Razor view engine - visual-studio-2010

I am currently working on MVC 2 with visual studio 2010 and view engine as ASPX kind of project.
So I have decided to move with Visual studio 2012 with MVC 4 and view engine as Razor.
So could I achieve above task.If so How ?
I would like to hear your experience for similar kind of situation.
Note : My project is a large one.

Create a new MVC4 project in Visual Studio 2012 and add source files from your old solution to your new solution one at a time. Moving from MVC3 to MVC4 is easier with a new solution, I have to imagine that going from 2 -> 4 would be even more complex to try to upgrade in-place.
Conversion from ASPX to Razor should probably be done manually. Although there are converters out there (like this one or code like the accepted answer in this SO question), I personally wouldn't trust my application to pure automation.
Also, I would probably convert one at a time. In other words, convert from ASPX -> Razor or MVC2 -> MVC4 first and make sure everything works with your conversion. Then convert the other one so that if you run into any problems, you don't have to try to figure out whether it's the version upgrade or the syntax upgrade that caused your problem.

Related

Web development in Visual Studio (not ASP.NET) - Is it possible?

I've wondering if it's possible to use visual studio (2013) to develop a HTML5 based website (HTML5-CSS-jQuery-etc), like Dreamweaver (which I hate by the way). Working with MVC Views was so easy because of IntelliSense, so that's why basically asking this. I want make a webpage, but the only option is ASP.NET...
For all those who are going to ask: Yes I've searched about this, but all the tutorials were about ASP.NET
Visual Studio 2012+ offers built-in support for HTML5 as explained in this article: http://msdn.microsoft.com/en-us/magazine/jj618298.aspx. You can create an empty web site and write your code/markup in it.
For the earlier 2008-2010 versions there is a VS extension:
http://visualstudiogallery.msdn.microsoft.com/d771cbc8-d60a-40b0-a1d8-f19fc393127d

Missing razor intellisense and keyboard shortcut behavior in MVC 5 - visual studio 2012 with Resharper

I have started an MVC 5 empty project and imported most of my stuff from another project to this one using most of this link. However I soon found out that I was having other kinds of troubles. I have since then downloaded ASP.NET and Web Tools 2013.1 for Visual Studio 2012 and installed it, and it only solved my problem partially.
As of right now my Razor syntax works, but I lost some really nice functionalities. Here's an example:
<li>
Orders
</li>
Today's date: #System.DateTime.Now
So when I type the #System.DateTime.Now line, the intellisence does work and offers the good options. However, if I type the Orders, as of before when writing the SearchOrders line the intellisence would provide the names of the actions included in the controller, however with MVC 5 and Visual Studio 2012 it is no more the case.
So if I type a missing action the support will not anymore warn me that the action is missing, nor will it offer me to create the action in my controller, and so on. In the same way, if I hit F12 on a View() line, Visual Studio 2012 will open the metadata class instead of showing the .cshtml file.
Is there something missing to gain back those functionalities? I've tried with an MVC 4 Web Application framework and things were working fine.
EDIT after user Erik pointed out that it was related to Resharper's code completion and other features, I am now searching as to why Resharper v 7.1.x does not seem to be able to deal with MVC 5 and its features.
As Erik Funkenbush (see comments on my main post) mentioned, the data lacking was actually part of Resharper's behavior and was not related, as I thought, to Visual Studio.
The main question was why Resharper 7.1.x did not seem to be able to cope with MVC 5 - Razor 3. I have not found the answer to that question, but I have installed Resharper 8 and all those lost functionality are back.
So if you ever stumble upon this problem, try an updated version of Resharper, it might be your solution.

Asp.net MVC View slow preformance issue

I am having some trouble when I am trying to some razor and html code inside my MVC Views. Visual studio keeps hanging and not responding. When entering a simple tag it can take a few mins to appear. It seems to be a performance issue with asp.net views.
The problem only occurs when inside the views. when coding in the model and the controller I don't have any of the issues.
I am using Visual Studio 2010. Even at home on a better spec machine I have the same issue only the view run really slow.
Has anyone else noticed any performance issues when trying to develop a asp.net MVC 4 view?
Is there any fixes out there for this.

While learning SharePoint 2010, what View Engine should i use in ASP.NET MVC 3?

While learning SharePoint 2010, what View Engine should i use in ASP.NET MVC 3?
My goal is to choose a View Engine that also helps improving my skills developing for SharePoint 2010.
My guess is the ASPX, but im not really sure.
Since there is no Razor in SharePoint 2010, you should probably go the ASPX way.
But Razor is really nice in ASP.NET MVC... I would probably work with both. You will spend much more time by writing XML configuration than ASPX pages in SharePoint anyway, so it's not that big deal.
Use a modified version of Razor Views:
http://tqcblog.com/2011/01/23/asp-net-mvc-controller-actions-in-sharepoint/

Upgrading Compact Framework 1 app from VS 2003 to VS 2005 breaks form designer?

I am trying to move a C# Compact Framework 1 application from Visual Studio 2003 to Visual Studio 2005 (no comments please on how outdated all this is :-)). I am now able to compile and run the app in VS 2005 just fine, however when I open one of the forms, the form designer does not show the actual form layout but just some rows of icons, one for each control on the form. I have no idea why, or how to get back the standard form designer view. Does anybody have any experience with that and any hints or tips?
Well some things changed while going from VS2003 to VS2005 one of those things is the way the form designer adds code to your Form class. It creates a separate .designer.cs class and creates a partial class with the same name as you main form class. All the designer generated code now goes in this background class. This is done so that the form designer generated code stays out of your hair.
Now its plausible that the VS2005 designer no longer recognizes the in-file designer code generated by the previous version. You can try to create a new WinForms project and see how it differs from your current project then make appropriate amends to your current project.

Resources