Downgrade/convert mvc 4 to mvc 3 - asp.net

I know this is a rather odd question, please don't flame me :)
I have a concrete need to "downgrade" a current Asp.Net Mvc 4 (net framework 4.5) application to Asp.Net Mvc 3 (net framework 4.0) because our shared hosting provider does not support .Net 4 (I know it's crazy considering it's been in retail since 12 Aprli 2010 and first beta came out in May 2009 but it's not the point of the post).
Is there any tool, or guide, or anything that could help in the process? I'm getting a bit lost because I upgraded many
applications
but I never had to downgrade one.
I have use some of the features like begincollectionitem which may not be direct compatible to mvc3

I doubt you'll find an official guide or tool, you'll have to do it manually. Personally, I would do the following:
Start a new MVC 3 Project (MVC3 is available via nuget)
Copy your files from one to the other
Fix any compilation issues
Use the publish site feature to publish somewhere locally (this will hopefully find compilation issues in your Razor views which don't get found during the project build)
Test the site fully!
Sorry it's not more helpful, but I don't think people generally design for the downgrade process.

Related

How to upgrade my existing .net project to asp.net core 1.0?

I am in the middle of the development of a project.I am using asp.net framework 4.5.So far what I have developed, I have to publish it on a Linux server. So i fount that, I will have to upgrade my existing project to ASP.NET Core 1.0 in order to publish on Linux server. Can anyone please suggest me how can I achieve my goal?
You may encounter a couple of issues and looks for different solutions but a general guide can be found here: Migrating From ASP.NET MVC to ASP.NET Core MVC
For specific errors when the general migration will be done, it's worth to take a look at ASP.NET Core's GitHub page as a lot of issues that can occur during migration is described there.

How to port to .NET core?

I was looking for possibilities for porting some web projects from Windows .NET framework to Ubuntu linux using open source .NET core
After a lot of struggle with Mono, which I have almost gave up. I was looking at .NET core as a new hope. Have anyone of us ported from .NET to .NET core?
If yes, can the possible problems like the ones I faced with Mono be shared?
Moving from .NET to .NET Core is a huge move, especially if you're going to take advantage of Core. There is not currently a one click port, and I doubt you'll ever get a one-click migration like migrating from a VS 2013 project to a VS 2015 project. The entire startup flow is different, and to automate switching to that would be incredibly difficult. For now, the way I am looking at it is that moving to .NET Core is essentially a rewrite. As to whether that is worth it to you for your project - well that's really hard to say and also probably not well suited to that site.
That said, if you do rewrite you can probably bring along a lot of your business logic. You just will need to redo a lot of the other structure.
There's no easy way to move a project from .NET Framework to .NET Core. Possibly you'll need to rewrite or start from scratch.
There are some major differences between two
Format of configuration files (web.config vs appsettings.json)
Used libraries
Startup files (Global.asax vs Startup.cs)
Lack of static objects in .Net Core. Like Session and Application
objects - which is a good thing btw.
Many of the .Net Framework libraries are dependant on
app.config/web.config files

Future plans to consider for asp.net mvc 5.2 web application, with releasing asp.net mvc6 (vnext)

I need to get any ideas of how i should be managing our previous asp.net MVC 5.2 web application.. now i am using asp.net mvc-5.2 with entity framework 6.0. and i want to start phase-2 for some of these projects. so should i consider upgrading my mvc 5.2 to be using mvc6 (vnext) first ? and will there be any migration plans ?
second question , when is it expected for vnext to be released? or it is has been officially released ?
third question, will i be able to create a vnext project inside VS 2012 ?
I would simply recommend following the standard best practice of n-tier architecture and keeping logic related to things like querying a database in class libraries. MVC 6 is drastically different from previous versions, so there's no easy migration. You'll basically need to start a brand new project and move over relevant code where you can and spend a good bit of time converting code. For example, child actions are gone and have been replaced with view components. You'll need to go through any child actions you're using currently and create view components out of them. As I said, making sure your current MVC project is as thin as possible (by factoring out code into class libraries and such) will go a long way in reducing the amount of code you need to move/change.
As far as I'm aware, no release date has been set, but at least in the alpha and beta phases of Visual Studio 2015 and ASP.NET 5/MVC 6, Windows 10 has been required, so there won't be an official release likely until Windows 10 is public. However, Visual Studio 2015 has reached release cadidate stage, so I'd say it's definitely close, either launching alongside Windows 10 or shortly after.
Kind of answered this in point 2, but ASP.NET 5/MVC 6 will require VS2015. As far as I'm aware, there's no plans to add support to lesser versions. A lot of that has to do with Rosyln, the new .NET compiler. Trying to bootstrap previous versions of VS with support for an entirely new compiler/syntax engine would be a monstrous task. However, VS has been on an MSDN subscription model for many versions now and as long as you're a current subscriber you can always download the latest version for free. If you're not an MSDN subscriber, you can still download the community edition of VS 2015 for free. It's missing a lot of the more advanced VS features, but it's still totally sufficient for web development work.

Can i have some advice if i should start using asp.net mvc 4 instead of asp.net MVC 3

i already built some web applications using asp.net MVC 3 and they work well, and currently i am in the state of starting a new web application for a medical clinic ; but i need to have some advice if i should consider using asp.net MVC 4 beta version instead of asp.net MVC 3?
thanks in advance for any help and suggestions ?
BR
Personally I would start in MVC3 and then upgrade the project to v4 when it's RTMd. Previous versions have had some issues when migrating from Betas (altho see update below).
You can be sure, however, that as with previous version increments, a swift and easy upgrade path will be available (usually there's a project conversion tool released at the same time).
I have a project I'm working on right now, and if I get to the web layer before v4 is finished, I'll be starting in v3 first.
I suppose it does depend, however, on whether any of the new features, such as the adaptive rendering via Mobile views (or indeed the Web API), are intrinsic to your solution. Just don't release on a beta platform :)
Update July 2012
I ended up getting to the web layer of my current project before v4 RTM so decided to go to the RC release first; then the nightly nuget packages for Web API support.
Apart from editor issues (that are documented), I've found no issues, even with integrating a whitelabelling extensibility library I've written, for MVCs 1-3, that operates at a very low level.
Would I have migrated early if I'd not needed the numerous benefits that the Web API provides? Probably not.
But as it is, I'm glad I did :-)
Unless you have a specific reason to use MVC 4 (perhaps a feature that isn't in MVC 3) I would stray away from using beta software for a customer/client. Who knows what bugs/issues you'll have to work around when developing the application or when you upgrade from beta to general release.
There's a reason it's in beta.
As Mackie says.. unless you need a specific feature in MVC4, i'd stay with MVC3. MVC4 is mostly just new features, and has very few changes in the way MVC itself works.
I disagree with Mackie in his comment about "there's a reason it's in beta", in fact MVC4 is very stable and has a go-live license to allow you to use it in production code. It's just that things may still change before final, which is tied more to VS11 than how stable it is.
For my thesis I want to develop an application in ASP.NET MVC, so a few weeks ago I had to make the same decision like you. This is my conclusion:
I should advice to use MVC3 (because it's stable) for your business projects.
There are some known issues ( http://www.asp.net/whitepapers/mvc4-release-notes#_Toc303253815 ) in MVC4 beta, so it would be a waste of time to get stuck one day because of beta problems.
When the time is there you'll be able to convert MVC3 with ease to MVC4. So don't hesitate and choose for MVC3 for now. You can decide later on if you want to upgrade or not.
At the link below you'll see how to easily upgrade from MVC3 to MVC4 at this moment: http://www.asp.net/whitepapers/mvc4-release-notes#_Toc303253806

Help with asp.net mvc 1.0 or 2 in Visual Studio 2010

I currently joined a team that is working on an asp.net mvc 1.0 app.
The app is quite large so changing to mvc 2 right now is not an option.
I have visual studio 2010 Ultimate which doesnt come with mvc 1.
When I tried running opening the solution in my computer I got a conversion wizard. I tried following it but the app just doesnt compile.. it gives plenty of errors and they are all related to mvc 2 new additions
My question is.
Can you run asp.net mvc 1 apps in Visual Studio 2010?
thanks ind advance
I had the same frowning eye brows when I encountered that. A simple download and install of ASP.NET MVC 1.0 is what you need.
The app is quite large so changing to mvc 2 right now is not an option.
Did you try? Mostly 2.0 just adds new cool things to 1.0 like areas and better validation (also client side). It's of course your decision but if the architecture team lets you I suggest you try to upgrade and continue on that.
You need to download ASP.Net MVC 1.0.

Resources