2010-04-25 150 views
1

我有一個ASP.Net MVC 2網站,可以通過ASP.Net Development Server中的http://localhost/Admin/ContentMgr/從Visual Studio 2010(RTM Retail)訪問。將ASP.NET MVC 2應用程序部署到Windows 2008 R2

當我嘗試部署站點到Windows 2008 R2,IIS 7.5中,URL總是返回404

首先,我的應用程序池在.NET 4.0和集成模式下運行。 其次,我的IIS確實有「HTTP錯誤」和「HTTP重定向」功能

而這是我的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> 
+0

你有沒有安裝asp.net 3.5或以上版本,還有asp.net mvc 2?你是否還檢查過驗證是否有效,以及該網站是否可以真正被訪問,並且最終是否將你正在使用的網站url綁定到在公共端有效的IP地址,或者至少是在NAT上有效的IP地址可從NAT訪問。最後但並非最不重要的一個test.html頁面只需要說出單詞測試並顯示在您的瀏覽器中 – davethecoder 2010-04-25 13:01:19

+0

您是否需要在Win 08服務器上安裝ASP.Net MVC以及獲取MVC 2應用程序的工作?我只是在我的盒子上安裝了.NET 4.0,我假設MVC帶有它。 – Picflight 2010-06-10 09:26:49

回答

0

ASP.net MVC 2不包括在.NET 4有兩個選項:

  1. System.Web.Mvc.dll文件部署到你的應用程序
  2. 安裝ASP.net的/ bin文件夾MVC 2在服務器上following this cryptic procedure
相關問題