Question

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 3 (net framework 4) application to Asp.Net Mvc 2 (net framework 3.5) 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.

Besides strictly MVC, I'm using a data layer with EF Code First (maybe nhibernate will be the best tool to replace that?)

Any help, tip, info, whatever is appreciated.

Thanks.

EDIT: Changing hosting provider is not an option, otherwise I wouldn't have posted this at all. I personally am against this downgrade - I find it totally senseless - but still it's the only option.

Was it helpful?

Solution

I would change hosting provider. If your provider is not supporting .NET 4.0 now then do you really want to build a long term relationship with them? What happens the next new great feature is released, how long will they take to implement that? I don't think there's any future there if that's the kind of service they provide.

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

  1. Change the project's target framework setting in Visual Studio to 3.5.
  2. Remove MVC 3 and add MVC 2
  3. Change all Razor views to the Web Forms view engine syntax
  4. Recompile and work through all the errors

For your web.config file I would create a new MVC 2 project and work from that web.config copying any extra settings needed from your old config.

Depending on the size of the project this is obviously going to a be a big task.

OTHER TIPS

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

This will generate lots of errors.

Actually - this might be the way to convince those that hold the purse strings that you need to change hosting provider. You can show them the error list and put an estimate on how long it will take to fix them. If this is a long time (a couple of weeks?) then it might be more cost effective to move.

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

  1. Just make a new website
  2. Then Select .net Framework 2.0
  3. Copy the all files except web.config file from your asp.net 4.0 website folder in the new website folder
  4. remove the unused usings from all the .vb or .cs files
  5. Run the website easily
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top