42

I have my MVC 5 application that I create in VS 2013. Now I'm trying to deploy this application and I have a question: Can I deploy MVC 5 on the server with 4.0 .Net Framework?

I just create Deploy Package and I have tried to import this package in IIS. It says "Import success", but when I try to "Browse" Web Site It says:

HTTP Error 403.14 - Forbidden

The Web server is configured to not list the contents of this directory.

I just checked Directory Browsing and it's Enabled in IIS

Bryuk
  • 3,295
  • 10
  • 45
  • 74

2 Answers2

60

Nope, ASP.NET MVC 5 requires .NET 4.5 at least. Directory browsing is not the problem, don't turn it on. Check the Event Viewer for errors.

I can't link to any official source for this statement but you only get ASP.NET MVC 4 project template when you switch to .NET 4.0.

Ufuk Hacıoğulları
  • 37,978
  • 12
  • 114
  • 156
3

I tried it and got this error:

Install-Package : Could not install package 'Microsoft.AspNet.Razor 3.0.0'. You are trying to install this package into a project that targets '.NETFramework,Version=v4.0', but the package does not contain any assembly references or content files that are compatible with that framework. For more information, contact the package author.

So due to the transitive dependency on Razor 3+, it isn't available for .NET 4 via NuGet.

Sam
  • 40,644
  • 36
  • 176
  • 219
  • 3
    If you have a new question, please ask it by clicking the [Ask Question](http://stackoverflow.com/questions/ask) button. Include a link to this question if it helps provide context. – Reporter Aug 20 '14 at 11:38
  • 5
    @reporter, this isn't a question; it's an answer that backs up the accepted answer. I could probably have worded it better, but I don't really have time. – Sam Aug 20 '14 at 23:08
  • 5
    @reporter, I'm not sure what you mean by "reasons had spoken before". If you're wondering why this isn't posted as a comment, it's because it's an answer rather than a comment. Also, SO comments aren't suitable for block quotes like the one in this answer. – Sam Aug 21 '14 at 10:38