Having trouble deploying an ASP MVC application on a regular shared hosting provider

I bought a Windows Developer hosting package from fasthosts.co.uk, which I believe is the standard hosting package for boxing. It has ASP.NET 3.5 and, according to their support, also has SP1.

I developed my web application using ASP MVC 2 preview 1 (which, by the way, is awesome, and I look forward to getting stuck in preview 2), and it works fine on my dev machine, which I have a preview on 2 installed through the installer package.

Since there is no MVC installed on the server, I followed the Phil Haaks bin bean deployment method , which does not work because it happened ...

When I deploy it and copy the files to the server, I get a simple useless "Server Error 500 - Internal Server Error". Therefore, I changed my web configurator so that customErrors mode = "Off", which did not matter, so I decided that something was happening that stops it even from getting into user error bits.

Then I started to extract the bits of the web configuration until it gave me a decent error message. I found that this will give me an error message if the following bits have been removed from the configuration -

  • The entire section "Configuration"
  • Entire httpHandlers section
  • The entire system.codedom section
  • The default handlers and sections for the document. web server section

-, MVC , , .

, , " System.Web.Mvc...", ! - ?

Edit:

- , ! , Fasthosts, MVC, Phils, - - .

, , -. , , , 12- , - .

, , , .

+3
6

, -. ? MVC.

+2

, , Q & A MVC 5 Fasthosts. , runAllManagedModulesForAllRequests="true" web.config, :

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

!

, , . , , web.config, :

    <modules>
      <remove name="UrlRoutingModule-4.0" />
      <add name="UrlRoutingModule-4.0" type="System.Web.Routing.UrlRoutingModule" preCondition="" />
      <!-- any other modules you want to run in MVC e.g. FormsAuthentication, Roles etc. -->
    </modules>
+2

- , system.webserver - ( ). - MVC fasthost, ... , . , system.webserver. .aspx .mvc:(

+1

MVC :

aspx :

  routes.MapRoute(
            "Default", // Route name
            "{controller}.aspx/{action}/{id}", // URL with parameters
            new { controller = "Front", action = "Default", id = UrlParameter.Optional }
        );

  routes.MapRoute(
            "Root",
            "",
            new { controller = "Front", action = "Default", id = "" }
          );

, Root , 403 " ", default.aspx , OnInit "~/Front. aspx/Default" ( , Front Home).

DLL Mvc Local, bin.

HtmlAction , aspx.

, , -, , , .

+1

Global.asax -... , , (, , 500).

, ASPX - ? , ? , , ASP.NET 3.5 , / ASP.NET IIS.

0

ASP.Net MVC 2 . dll , " " "true".

-1

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


All Articles