IIS7有一個applicationHost.config文件,該文件具有限制的文件擴展名安全部分:
<requestFiltering>
<fileExtensions allowUnlisted="true" applyToWebDAV="true">
<add fileExtension=".cs" allowed="false" />
<add fileExtension=".csproj" allowed="false" />
<add fileExtension=".vb" allowed="false" />
<add fileExtension=".vbproj" allowed="false" />
....
</fileExtensions>
的更多信息:
http://learn.iis.net/page.aspx/143/how-to-use-request-filtering/
我添加了一個類似的部分,我的網站的web.config和使用<clear />
節點刪除所有擴展。現在我可以提供.cs,.csproj文件和其他文件,但是我還無法提供.config文件。
編輯:刪除hiddenSection節點也對web.config文件進行了更正。這裏是我的本地web.config文件:
<system.webServer>
<security>
<requestFiltering>
<fileExtensions allowUnlisted="true" applyToWebDAV="true">
<clear />
</fileExtensions>
<verbs allowUnlisted="true" applyToWebDAV="true" />
<hiddenSegments applyToWebDAV="true">
<clear />
</hiddenSegments>
</requestFiltering>
</security>
</system.webServer>
是的,這爲我工作。 +1 – 2011-08-05 18:11:47
這就是答案。謝謝! – Alexandr 2017-04-07 12:10:43