IIS Configuration - ASP.NET MVC Returns the Default Document for All Requests

So, I have a MVC web application built on VS 2013. I was able to successfully run this application through IIS on my local machine without any problems. However, now I need to host on the remote machine. I followed the same steps as on my local machine, but I keep getting errors.

When I try to view a web application, I get an HTTP error message Error 403.14 - Forbidden The web server is configured to not display the contents of this directory. However, I created the document by default, since the details of this error tell me and now every time I try to access the application (localhost / MyWebApp), it simply goes to this default.html.

However, when I indicate that I want to go to a specific controller (for example, localhost / MyWebApp / Home), I get error 404 (HTTP Error 404.0 - Not Found The resource you are looking for has been deleted, its name has changed or is temporarily unavailable.)

In the machine on which I am currently trying to install the host, visual studio is not installed for various reasons, but I installed ASP.NET MVC 3 and .NET 4.5 Framework on it. The default website also has classic.net running on remote IIS computers.

My thoughts are:

1 - I miss some of the prerequisites needed to host the asp.net mvc application (maybe something that is installed with visual studio)

or

2 - something in IIS is incorrectly configured.

Any advice is appreciated as few hours of work are unanswered and I have exhausted my knowledge of IIS

Edit

.

+3
4

, , , MVC IIS 7.0?

, , , -, runAllManagedModulesForAllRequests true. .

, -

From:

<system.webServer>
    <modules>
      <remove name="FormsAuthenticationModule" />
    </modules>
</system.webServer>

To:

<system.webServer>
    <modules runAllManagedModulesForAllRequests="true">
      <remove name="FormsAuthenticationModule" />
    </modules>
</system.webServer>
+3

runAllManagedModulesForAllRequests .
. .

, UrlRoutingModule. MVC nugets . , .

ASP , ASPX JPG, URL-. MVC , MVC .

, .

-, , . IIS, , "" , UrlRoutingModule . , MVC. webconfig, .

, , .

IIS "" "". , , - .

, , . , webconfig :

<?xml version="1.0" encoding="UTF-8" ?>
<configuration>
  <system.webServer>
    <modules>
      <remove name="UrlRoutingModule-4.0" />
      <add name="UrlRoutingModule-4.0" type="System.Web.Routing.UrlRoutingModule" preCondition="" />
    </modules>
  </system.webServer>
</configuration>

MVC http://example.com/myapplication/ , " ", URL.

+3

, "localhost/MyWebApp/Views/Home/Index.cshtml" MVC. "localhost/Home/". , - , 80- . MyWebApp - , 80- , , .

0

ASP MVC 4 ( IIS ):

.cs IIS , IIS .

Just right-click on the file cshtml, and then click "View in Browser." It will launch IIS, and then you can edit any .cs file and view the output of any "view" at the same time.

0
source

All Articles