Reduce Asp.net Mvc from 3 to 2

I know this is a rather strange question, please don't flame me :)

I have a specific need to “downgrade” the current Asp.Net Mvc 3 (net framework 4) application for Asp.Net Mvc 2 (net framework 3.5) because our shared hosting provider does not support .Net 4 (I know this is crazy given that it has been in retail since April 12, 2010, and the first beta was released in May 2009, but this is not the point of communication).

Is there any tool or guide or anything that can help in this process? I'm a little lost because I updated a lot of applications, but I never had to downgrade it.

Besides strictly MVC, I use the data layer with EF Code First (maybe nhibernate would be the best tool to replace it?)

Any help, hint, information, anything appreciated.

Thanks.

EDIT . Changing the hosting provider is not an option, otherwise I would not have published it at all. I am personally against this demotion - I think this is completely pointless - but still this is the only option.

+4
source share
3 answers

I would change the hosting provider. If your provider does not support .NET 4.0, then do you really want to build a long-term relationship with them? What happens when the next great new feature is released, how long will it take? I don’t think there will be any future if this is the service they provide.

Saying that if you have no choice but to stay with them, I think your only option is

  • Change the target project target environment setting in Visual Studio to 3.5.
  • Remove MVC 3 and add MVC 2
  • Change all Razor views to the syntax of the web form viewer.
  • Recompile and complete all errors.

For your web.config file, I would create a new MVC 2 project and work with this web.config, copying any additional settings needed from your old configuration.

Depending on the size of the project, this will obviously be a big task.

+5
source

The only way I can think of is to install a machine with MVC 2 installed, get the project and try to compile it with .NET 3.5 targeting.

This one will generate a lot of errors.

Actually - this may be a way to convince those who hold the wallet lines that you need to change the hosting provider. You can show them a list of errors and indicate how long it will take to fix them. If this is a long time (a couple of weeks?), Then it would be more profitable to move.

+2
source

You can easily convert asp.net 4.0 website to asp.net 2.0

  • Just create a new website.
  • Then select .net Framework 2.0
  • Copy all files except the web.config file from the asp.net 4.0 website folder to the new site folder
  • delete unused files from all .vb or .cs files
  • Launch a website easily.
0
source

Source: https://habr.com/ru/post/1345524/


All Articles