Migrating from MVC 5 to mvc 4

I created an application with ASP.Net 4.5 and MVC5; however, the hosting server I use does not support MVC5. So I need to upgrade to MVC4.

I can use ASP.Net 4.5 or ASP.Net 4, my application runs on both frameworks.

I tried the following steps from this question or this or this :

  • Right-click on the project in Solution Explorer (in Visual Studio) and select Properties.
  • Change the Target Framework drop-down list to all the frames you want to customize.
  • Do the same for any other projects or test projects in the solution that you also want to change the target structure for.
  • Manually edit the .csproj file in a text editor and replace all the lines "net45" with "net40"
  • In Visual Studio, click the Tools menu and select Library Package Manager> Manage NuGet Package Solutions
  • Click "Updates"
  • Update all Microsoft packages
  • Click Restart Now.
  • Reconstruction of the project.

Everything works fine until step 4. However, MVC packets are not redefined until MVC4.

I also tried to create an MVC 4 application, but since I am using Visual Studio 2015, this option is not provided to me.

Any ideas on how to seamlessly upgrade to MVC4? Thanks:)

+5
source share
2 answers

No, ASP.NET MVC 5 at least requires .NET 4.5. Browse the catalog is not a problem, do not turn it on. Check for event view errors.

I cannot reference any official source for this expression, but you only get the ASP.NET MVC 4 project template when you switch to .NET 4.0.

0
source

Downgrading ASP.NET MVC to version 4 is the answer here ...

You do not say whether MVP 5 is explicitly supported by your provider or if it is implied because it is not included in the list of supported frameworks.

If this is the last, have you tried to actually deploy the application to see if it works?

You should be able to Bin Deploy ASP.NET MVC 5, making sure that the appropriate assemblies are deployed along with the rest of your application.

0
source

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


All Articles