4

Sitting with an interesting problem. .NET 4.5 is not supported on the server (client didn't mention this)

BUT the app is written using ASP.NET MVC 5 (which only runs on .NET 4.5).

So downgrading the dot net means to downgrade the ASP.NET MVC version.

One of the many errors we are getting is

The type or namespace name 'Mvc' does not exist in the namespace 'System.Web'

I can only assume this is due to the implementation of all the Owin middleware in ASP.NET MVC 5.

Has anyone had any experience with removing these references and being ASP.NET MVC 4 capable?

Following Greg's suggestion below I ran the nuget which removed v5, and added in v4, but now all the Owin stuff is an issue

Crudler
  • 2,194
  • 3
  • 30
  • 57
  • Have you installed the v4 nuget? http://www.nuget.org/packages/Microsoft.AspNet.Mvc/4.0.30506 – Greg B Aug 01 '14 at 11:35
  • Have you tried to target .NET Framework 4.0 in your solution first? – Panayotis Aug 01 '14 at 11:42
  • Greg, i followed your suggestion. Thanks cleared up a lot of code issues. still sitting now with all the owin stuff - see main post – Crudler Aug 01 '14 at 11:44

1 Answers1

4

Try these steps:

  1. Right click on the project in the Solution Explorer (in Visual Studio) and select Properties.
  2. Change the Target Framework drop-down to whatever framework you now wish to target.
  3. Do the same for any other projects or test projects in the solution, that you also wish to change the target framework for.
  4. Manually edit the .csproj file in a text editor and replace all "net45" strings to "net40"
  5. In visual Studio, click the Tools menu and select Library Package Manager > Manage NuGet Packages for Solution
  6. Click on Updates
  7. Update all Microsoft packages
  8. Click Restart Now.
  9. Rebuild project.
Panayotis
  • 1,743
  • 1
  • 17
  • 30
  • Thanks u,but I am sure there are more steps than that? what about all the references to Owin. And I am sure the start up stuff will need changing – Crudler Aug 01 '14 at 12:12
  • Well, these are some basic steps. Depending on what extra packages are installed in the project extra steps may be needed.. – Panayotis Aug 01 '14 at 12:33