【发布时间】:2010-04-25 09:45:55
【问题描述】:
我有一个 ASP.Net MVC 2 网站,可以通过 Visual Studio 2010(RTM 零售)的 ASP.Net 开发服务器中的http://localhost/Admin/ContentMgr/ 访问该网站。
当我尝试将站点部署到 Windows 2008 R2 、 IIS 7.5 时,url 总是返回 404。
首先,我的应用程序池在 .Net 4.0 和集成模式上运行。 其次,我的 IIS 确实有“HTTP ERROR”和“HTTP Redirection”功能
这是我的 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>
【问题讨论】:
-
您是否安装了asp.net 3.5 或更高版本以及asp.net mvc 2?您是否还检查了身份验证是否有效并且该站点实际上可以访问,最后您是否将您正在使用的站点 URL 绑定到在公共端有效的 IP 地址或至少绑定到您的 NAT 上的有效 IP可从 NAT 访问。最后但并非最不重要的一点是,放置一个 test.html 页面只需要说出单词 test 并且应该显示在您的浏览器中
-
您是否还需要在 Win 08 服务器上安装 ASP.Net MVC 才能使 MVC 2 应用程序正常工作?我刚刚在我的盒子上安装了 .Net 4.0,我假设它附带了 MVC。
标签: asp.net-mvc deployment windows-server-2008-r2