0

首先,我對重複一個問題,但它的解決方案惋惜:如何使用Windows Server 2008 R2和IIS 7.5部署ASP NET MVC 4 Web應用程序?

Solution

它不會爲我工作。我閱讀了這個解決方案中的文章,但我無法部署我的ASP NET MVC 4 Web應用程序。我嘗試這樣做:

<system.webServer> 
    <modules runAllManagedModulesForAllRequests="true" /> 
    ... 
</system.webServer> 

,我想這太:

<system.webServer> 
    <modules> 
    <remove name="UrlRoutingModule-4.0" /> 
    <add name="UrlRoutingModule-4.0" type="System.Web.Routing.UrlRoutingModule" preCondition="" /> 
    </modules> 
</system.webServer> 

我下載的更新:

有可用的更新,使某些IIS 7.0或者IIS 7.5的處理程序 到處理URL不以句號結束的請求

Windows Update

enter image description here

但是當我試圖安裝然後

enter image description here

我的工作:

-Windows Server 2008 R2的Service Pack 1的

-Internet信息服務7.5

- 視覺工作室2013更新2(發佈使用Web部署)

-.Net框架4.5

My Application Pools

我模塊

enter image description here

,最後我的web.config (沒有模塊標籤,因爲我使用了他們兩個,我得到了相同的結果)

<?xml version="1.0" encoding="utf-8"?> 
<!-- 
    For more information on how to configure your ASP.NET application, please visit 
    http://go.microsoft.com/fwlink/?LinkId=169433 
    --> 

<configuration> 
    <appSettings> 
    <add key="webpages:Version" value="2.0.0.0" /> 
    <add key="webpages:Enabled" value="false" /> 
    <add key="PreserveLoginUrl" value="true" /> 
    <add key="ClientValidationEnabled" value="true" /> 
    <add key="UnobtrusiveJavaScriptEnabled" value="true" /> 

    </appSettings> 

    <system.web> 

    <httpRuntime targetFramework="4.5" /> 

    <compilation debug="true" targetFramework="4.5" /> 

    <pages> 
     <namespaces> 
     <add namespace="System.Web.Helpers" /> 
     <add namespace="System.Web.Mvc" /> 
     <add namespace="System.Web.Mvc.Ajax" /> 
     <add namespace="System.Web.Mvc.Html" /> 
     <add namespace="System.Web.Routing" /> 
     <add namespace="System.Web.WebPages" /> 

     </namespaces> 
    </pages> 
    </system.web> 

    <system.webServer> 
    <validation validateIntegratedModeConfiguration="false" /> 
    <handlers> 
     <remove name="ExtensionlessUrlHandler-ISAPI-4.0_32bit" /> 
     <remove name="ExtensionlessUrlHandler-ISAPI-4.0_64bit" /> 
     <remove name="ExtensionlessUrlHandler-Integrated-4.0" /> 
     <add name="ExtensionlessUrlHandler-ISAPI-4.0_32bit" path="*." verb="GET,HEAD,POST,DEBUG,PUT,DELETE,PATCH,OPTIONS" modules="IsapiModule" scriptProcessor="%windir%\Microsoft.NET\Framework\v4.0.30319\aspnet_isapi.dll" preCondition="classicMode,runtimeVersionv4.0,bitness32" responseBufferLimit="0" /> 
     <add name="ExtensionlessUrlHandler-ISAPI-4.0_64bit" path="*." verb="GET,HEAD,POST,DEBUG,PUT,DELETE,PATCH,OPTIONS" modules="IsapiModule" scriptProcessor="%windir%\Microsoft.NET\Framework64\v4.0.30319\aspnet_isapi.dll" preCondition="classicMode,runtimeVersionv4.0,bitness64" responseBufferLimit="0" /> 
     <add name="ExtensionlessUrlHandler-Integrated-4.0" path="*." verb="GET,HEAD,POST,DEBUG,PUT,DELETE,PATCH,OPTIONS" type="System.Web.Handlers.TransferRequestHandler" preCondition="integratedMode,runtimeVersionv4.0" /> 
    </handlers> 
</system.webServer> 
</configuration> 

當我發表我的web應用程序是這樣的結果:

enter image description here

有沒有人有什麼我做錯了的想法?

回答

0

我無法通過點擊發布Web部署部署我的MVC Web應用程序,但我用下面的配置部署我的Web應用程序:

enter image description here

我並不需要使用這個標籤:

<system.webServer> 
    <modules runAllManagedModulesForAllRequests="true" /> 
    ... 
</system.webServer> 

<system.webServer> 
    <modules> 
    <remove name="UrlRoutingModule-4.0" /> 
    <add name="UrlRoutingModule-4.0" type="System.Web.Routing.UrlRoutingModule" preCondition="" /> 
    </modules> 
</system.webServer> 
相關問題