1

I have a ASP.Net MVC 2 web site, which can be visited by http://localhost/Admin/ContentMgr/ in ASP.Net Development Server from Visual Studio 2010(RTM Retail).

When I try to deploy the site to Windows 2008 R2 , IIS 7.5 , the url always return 404.

First, my application pool is running on .Net 4.0, and Integration mode. Second, my IIS do have "HTTP ERROR" and "HTTP Redirection" features on

And this is my web.config.

<?xml version="1.0" encoding="UTF-8"?>

<configuration>
  <system.web>
    <compilation debug="true" defaultLanguage="c#" targetFramework="4.0">
      <assemblies>
        <add assembly="System.Web.Abstractions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
        <add assembly="System.Web.Routing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
        <add assembly="System.Web.Mvc, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
      </assemblies>
    </compilation>
<!--
    <authentication mode="Forms">
      <forms loginUrl="~/Account/LogOn" timeout="2880" />
    </authentication>
-->
    <pages>
      <namespaces>
        <add namespace="System.Web.Mvc" />
        <add namespace="System.Web.Mvc.Ajax" />
        <add namespace="System.Web.Mvc.Html" />
        <add namespace="System.Web.Routing" />
      </namespaces>
    </pages>
  </system.web>

  <system.webServer>
    <validation validateIntegratedModeConfiguration="false" />
    <modules runAllManagedModulesForAllRequests="true" >
      <remove name="UrlRoutingModule"/>
      <add name="UrlRoutingModule" type="System.Web.Routing.UrlRoutingModule, System.Web.Routing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
    </modules>
    <handlers>
      <remove name="MvcHttpHandler" />
      <add name="MvcHttpHandler" preCondition="integratedMode" verb="*" path="*.mvc" type="System.Web.Mvc.MvcHttpHandler" />
      <add name="UrlRoutingHandler" preCondition="integratedMode" verb="*" path="UrlRouting.axd" type="System.Web.HttpForbiddenHandler, System.Web, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
    </handlers>
    <httpErrors errorMode="Detailed" />
  </system.webServer>

  <runtime>
    <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
      <dependentAssembly>
        <assemblyIdentity name="System.Web.Mvc" publicKeyToken="31bf3856ad364e35" />
        <bindingRedirect oldVersion="1.0.0.0" newVersion="2.0.0.0" />
      </dependentAssembly>
    </assemblyBinding>
  </runtime>
</configuration>
abatishchev
  • 98,240
  • 88
  • 296
  • 433
Mr.Wang from Next Door
  • 13,670
  • 12
  • 64
  • 97
  • have you installed asp.net 3.5 or above and also asp.net mvc 2? also did you check that authentification worked and that the site can actually be accessed, and finally did you bind the site url you are using to an IP address that is valid on the public side or at least to a valid IP on your NAT that is accessable from the NAT. last but not least put up a test.html page only needs to say the word test and should show in your browser – davethecoder Apr 25 '10 at 13:01
  • Do you need to install ASP.Net MVC on the Win 08 server as well to get a MVC 2 application working? I just installed .Net 4.0 on my box and I am assuming that MVC comes with it. – Picflight Jun 10 '10 at 09:26

1 Answers1

0

ASP.net MVC 2 is not included in .net 4. You have two options:

  1. Deploy the System.Web.Mvc.dll file into the /bin folder of your app
  2. Install ASP.net MVC 2 in the server following this cryptic procedure
Community
  • 1
  • 1
Eduardo Molteni
  • 38,786
  • 23
  • 141
  • 206