asp.net 4路由在IIS 7中不工作 [英] asp.net 4 routing not working in iis 7

查看:160
本文介绍了asp.net 4路由在IIS 7中不工作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我用asp.net 4路由在我们的新产品之一,它工作在开发环境(Visual Studio的Web服务器)的罚款。但是当我把它移动到远程IIS用于测试目的,这是行不通的。我得到的是404错误页面。我尝试添加下面的web.config中,仍然得到错误。

I'm using asp.net 4 routing in one of our new product and it works fine in the development environment (Visual studio webserver). but when i moved it to remote iis for testing purpose it doesn't work. all i get is 404 error page. i tried adding the following to the web.config and still getting the error.

<system.webServer>
     <modules runAllManagedModulesForAllRequests="true">    
     <add name="UrlRoutingModule" type="System.Web.Routing.UrlRoutingModule, System.Web, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" /> 
     </modules> 
 <validation validateIntegratedModeConfiguration="false" />
</system.webServer>

任何想法如何排序这个问题?

any ideas how to sort this issue?.

推荐答案

我得到这个解决方案......添加以下code在乌拉圭回合的web.config ..
 和不要忘了你的模块中添加runAllManagedModulesForAllRequests =真正的..

i got the solution for this ... add the below code in ur web.config .. and dont forget to add runAllManagedModulesForAllRequests="true" in your module..

   <system.webServer> 
        <modules runAllManagedModulesForAllRequests="true"> 
          <remove name="UrlRoutingModule"/> 
          <add name="UrlRoutingModule" type="System.Web.Routing.UrlRoutingModule, System.Web, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" /> 
        </modules> 
        <handlers> 
          <add 
            name="UrlRoutingHandler" 
            preCondition="integratedMode" 
            verb="*" path="UrlRouting.axd" 
            type="System.Web.HttpForbiddenHandler, System.Web,  
              Version=2.0.0.0, Culture=neutral,  
              PublicKeyToken=b03f5f7f11d50a3a"/> 
        </handlers> 
      </system.webServer>

这篇关于asp.net 4路由在IIS 7中不工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆