[英]asp.net, url rewrite module and web.config
我在IIS7(Vista)上使用帶有.NET 3.5的ASP.net和Microsoft的URL重寫模塊。
這意味着,我有一個
<system.webServer>
<rewrite>...</rewrite>
...
</system.webServer>
web.config中的部分,但我得到一個警告,在system.webServer中,不允許使用元素“rewrite”。
如何配置我的系統允許(甚至可能有Intellisense)在web.config的重寫部分?
謝謝Christoph
我能夠在Visual Studio 2010中使用它。
從Ruslan的帖子開始 ,下載2.0 IntelliSense文件。 然后,只要按照他事先發布的指示在這里 。 我最后做的就是按照Ruslan的指示運行以下命令:
C:\\download_directory\\rewrite2_intellisense>cscript UpdateSchemaCache.js
正如Christoph在評論中指出的那樣,如果您使用的是Visual Studio 2010,請確保在運行上述命令之前將VS90COMNTOOLS
替換為VS100COMNTOOLS
中的VS100COMNTOOLS。
我不需要重新啟動Visual Studio。 我只將<rewrite>
部分添加到適用的Web.config轉換文件中,因為它在主Web.config中打破了本地調試。
我相信您需要在web.config中定義模塊,如下所示:
<system.webServer> <modules> <add name="UrlRewriteModule" type="UrlRewritingNet.Web.UrlRewriteModule, UrlRewritingNet.UrlRewriter" /> </modules> </system.webServer>
更新:可以在此處設置Intellisense:
http://ruslany.net/2009/08/visual-studio-xml-intellisense-for-url-rewrite-1-1/
更新:驗證是否在%systemroot%\\ system32 \\ inetsrv \\ config \\ applicationHost.config中標識了sectionGroup:
<sectionGroup name="rewrite">
<section name="rules" overrideModeDefault="Allow" />
<section name="globalRules" overrideModeDefault="Deny" allowDefinition="AppHostOnly" />
<section name="rewriteMaps" overrideModeDefault="Allow" />
</sectionGroup>
我相信您需要在系統的web.config文件中“安裝”URL重寫模塊。
您需要通過IIS 7.0界面在應用程序上安裝模塊,或讓您的托管公司為您執行此操作。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.