これは多くの問題である可能性がありますが、IIS セットアップまたは web.config 構成で問題の原因を絞り込もうとしています。そこであなたの助けが必要です。以下に私の設定を説明します。通常、私は仮想ディレクトリではなく IIS 7 で Web サイトを作成しますが、ルート ディレクトリ (現在は縮小されていません) に多数の共有 JavaScript フレームワークがあり、それらのファイルを共有する多数のアプリケーションがあります。
私の理論では、Web サイト自体の構成はありません。Web サイトのパスは、仮想ディレクトリ パスの上のフォルダーです。これが必要だと何かが教えてくれますが、どのように見える必要があるか覚えていません。
考え?
このセットアップは、Windows XP 仮想ディレクトリのセットアップで問題なく機能することに注意してください。しかし、Windows 7 と Windows Server 2008 の両方でこのエラーが発生します。
ウェブサイトのエラーは次のとおりです。
テキストのエラー (検索用):
Server Error in '/' Application.
Configuration Error
Descriptionn: An error occurred during the processing of a configuration file required to service this request. Please review the specific error details below and modify your configuration file appropriately.
Parser Error Message: It is an error to use a section registered as allowDefinition='MachineToApplication' beyond application level. This error can be caused by a virtual directory not being configured as an application in IIS.
Source Error:
<compilation debug=true" targetFramework="4.0" />
ウェブサイトのURL:
http://localhost/app/index.aspx
(仮想ディレクトリが存在するサイトの) アプリ プールで次の 3 つの設定を変更しました。
「匿名認証」を無効にし、「Windows 認証」を有効にしました。
仮想ディレクトリ フォルダー (Web サイトのサブ フォルダー) 内の web.config ファイル:
<?xml version="1.0" encoding="UTF-8"?>
<!--
For more information on how to configure your ASP.NET application, please visit
http://go.microsoft.com/fwlink/?LinkId=169433
-->
<configuration>
<configSections>
</configSections>
<connectionStrings>
<!-- Local Machine -->
<add name="DATABASE" connectionString="Data Source=SERVERNAME\SQLEXPRESS;Initial Catalog=DATABASE-DEV;User ID=sa;Password=xxx" providerName="System.Data.SqlClient" />
</connectionStrings>
<!--<dataConfiguration defaultDatabase="DataAccessQuickStart">
<providerMappings>
<add databaseType="Devart.Data.Oracle.EnterpriseLibrary.OracleDatabase,Devart.Data.Oracle.EnterpriseLibrary" name="OracleX" />
</providerMappings>
</dataConfiguration>-->
<!--<location path="." allowOverride="true">
</location>-->
<system.web>
<compilation debug="true" targetFramework="4.0" />
<authentication mode="Windows" />
<authorization>
<deny users = "?" />
</authorization>
<membership>
<providers>
<clear />
<add name="AspNetSqlMembershipProvider" type="System.Web.Security.SqlMembershipProvider" connectionStringName="ApplicationServices" enablePasswordRetrieval="false" enablePasswordReset="true" requiresQuestionAndAnswer="false" requiresUniqueEmail="false" maxInvalidPasswordAttempts="5" minRequiredPasswordLength="6" minRequiredNonalphanumericCharacters="0" passwordAttemptWindow="10" applicationName="/" />
</providers>
</membership>
<profile>
<providers>
<clear />
<add name="AspNetSqlProfileProvider" type="System.Web.Profile.SqlProfileProvider" connectionStringName="ApplicationServices" applicationName="/" />
</providers>
</profile>
<roleManager enabled="false">
<providers>
<clear />
<add name="AspNetSqlRoleProvider" type="System.Web.Security.SqlRoleProvider" connectionStringName="ApplicationServices" applicationName="/" />
<add name="AspNetWindowsTokenRoleProvider" type="System.Web.Security.WindowsTokenRoleProvider" applicationName="/" />
</providers>
</roleManager>
<webServices>
<protocols>
<add name="HttpGet" />
<add name="HttpPost" />
</protocols>
</webServices>
<trace writeToDiagnosticsTrace="true" enabled="true" pageOutput="false" />
</system.web>
<appSettings>
</appSettings>
<!--<identity impersonate="true" />-->
<system.webServer>
<modules runAllManagedModulesForAllRequests="true" />
</system.webServer>
</configuration>