我正在尝试使用.NET和URLRouting动态创建XML文件......
在我的global.asax中:
routes.MapPageRoute("FederationMetadataRoute", "FederationMetadata/2007-06/{file}", "~/FederationMetadata/2007-06/FederationMetadata.aspx")
在我的global.asax中使用上述路由,下面显示了以下URL方案:
使用:
https://MyDomain.com/FederationMetadata/2007-06/FederationMetadata.xml/
https://MyDomain.com/FederationMetadata/2007-06/AnythingWithoutExtension
不起作用:
https://MyDomain.com/FederationMetadata/2007-06/FederationMetadata.xml
https://MyDomain.com/FederationMetadata/2007-06/AnythingWith.Extension
这是必须工作的网址,但不是:
https://MyDomain.com/FederationMetadata/2007-06/FederationMetadata.xml
答案 0 :(得分:0)
我明白了。显然我必须有runAllManagedModulesForAllRequests =“true”
<system.webServer>
<modules runAllManagedModulesForAllRequests="true">
...
</modules>
</system.webServer>