5

Windows Server 2008 R2 で IIS 7.5 を実行しています。「/bin」フォルダーを参照するとエラーが発生します
404: file not foundこれがマイクロソフトのセキュリティ ポリシーであることを理解しています。

ここに書かれていることをやってみましたが、問題は解決しませんでした。何か案は?

編集:
セキュリティ上の問題はないことに注意してください。プライベート ネットワークでディレクトリ ブラウジング用に IIS を実行しています。最終的には、クロールとインデックス作成を実行する必要があります。問題は、"/bin" および "/AppConfig" の下のページが 404 エラーのためにクロールされていないことです。

この問題の解決策が必要です。繰り返しますが、ここではセキュリティの問題は関係ありません。

4

2 に答える 2

12

Bin folder is not intended as a place where a developer should put web pages.

In IIS 7.5 you can configure

  1. Open Internet Information Services (IIS) Manager
  2. In the Connections pane, go to the connection, site, application, or directory for which you want to modify your request filtering settings.
  3. In the Home pane, double-click Request Filtering.
  4. In the Request Filtering pane, click the Hidden Segments tab
  5. Select the relative path that you want to show (BIN folder), and then click Remove in the Actions pane.

The same can be done via web.config

<configuration>
  <system.webServer>
   <security>
     <requestFiltering>
        <hiddenSegments applyToWebDAV="false">
           <remove segment="Bin" />
        </hiddenSegments>
     </requestFiltering>
   </security>
  </system.webServer>
</configuration>

Anyway, in orded to avoid problems on development server and on any deploy server, i think that the easiest solution is to move that pages to another folder.


Read here:

ASP.NET recognizes certain folder names that you can use   
for specific types of content.  
The following table lists the reserved folder names and the type   
of files that the folders typically contain.

Note
The content of application folders, except for the App_Themes folder,
is not served in response to Web requests,
but it can be accessed from application code.
  • App_Browsers Contains browser definitions (.browser files) that ASP.NET uses to identify individual browsers and determine their capabilities.
  • App_Code Contains source code for shared classes and business objects
  • App_Data Contains application data files including .mdf database files, XML files, and other data store files.
  • App_GlobalResources Contains resources (.resx and .resources files) that are compiled into assemblies with global scope.
  • App_LocalResources Contains resources (.resx and .resources files) that are associated with a specific page, user control, or master page in an application
  • App_Themes Contains a collection of files (.skin and .css files, as well as image files and generic resources) that define the appearance of ASP.NET Web pages and controls.
  • App_WebReferences Contains reference contract files (.wsdl files), schemas (.xsd files), and discovery document files (.disco and .discomap files) that let you create a Web reference for use in an application.
  • Bin Contains compiled assemblies (.dll files) for controls, components, or other code that you want to reference in your application.
于 2012-07-04T10:30:33.653 に答える
0
  • ネットワーク共有経由で \bin フォルダーにアクセスします。\\myserver\mysite\bin
  • \bin フォルダーをスキャンして結果を返す ashx ハンドラーまたは asmx Web サービスを記述します。Directory.GetFiles(Server.MapPath("~\bin"))
于 2012-07-04T08:09:18.813 に答える