asp.net 4 を使用してアプリケーションを作成しました。ローカル サーバーでは正常に動作しますが、外部サーバーに切り替えると、web.config に奇妙な問題が発生し、このエラーが発生します。
[500 - Internal server error.
There is a problem with the resource you are looking for, and it cannot be displayed.
]
.
セクション内に<compilation>
いくつかの問題があるようです。セクションを削除すると<compilation>
、アプリケーションを表示して実行できますが、データベースにアクセスすることはできません。
web.config
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<configSections></configSections>
<appSettings />
<connectionStrings>
<add name="ImmoEntities" connectionString="metadata=res://*/Model.ImmoModel.csdl|res://*/Model.ImmoModel.ssdl|res://*/Model.ImmoModel.msl;provider=MySql.Data.MySqlClient;provider connection string="server=XXXXX;Password=XXXXX;User Id=XXXXX;database=XXXXX"" providerName="System.Data.EntityClient" />
</connectionStrings>
<system.web>
<globalization culture="auto:fr-FR" uiCulture="auto:fr-FR" />
<siteMap defaultProvider="XmlSiteMapProvider" enabled="true">
<providers>
<clear />
<add name="XmlSiteMapProvider" type="System.Web.XmlSiteMapProvider" siteMapFile="Web1.siteMap" />
<add name="web1" type="System.Web.XmlSiteMapProvider" siteMapFile="/Web1.sitemap" />
<add name="web" type="System.Web.XmlSiteMapProvider" siteMapFile="/Web.sitemap" />
<add name="web3" type="System.Web.XmlSiteMapProvider" siteMapFile="/Web3.sitemap" />
<add name="web4" type="System.Web.XmlSiteMapProvider" siteMapFile="/Web4.sitemap" />
</providers>
</siteMap>
<!-- Web.Config Configuration File -->
<compilation debug="true" targetFramework="4.0">
<assemblies>
<add assembly="System.Design, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A" />
<add assembly="System.Data.Entity, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<add assembly="System.Web.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
<add assembly="System.Web.Extensions.Design, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
<add assembly="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089" />
<add assembly="System.Web.DynamicData, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
<add assembly="System.Core, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089" />
<add assembly="System.ComponentModel.DataAnnotations, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
<add assembly="System.Data.Linq, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089" />
<add assembly="System.Web.Entity, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089" />
<add assembly="System.Xml.Linq, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089" />
</assemblies>
</compilation>
<!--
Set compilation debug="true" to insert debugging
symbols into the compiled page. Because this
affects performance, set this value to true only
during development.
-->
<!--
The <authentication> section enables configuration
of the security authentication mode used by
ASP.NET to identify an incoming user.
-->
<authentication mode="Windows" />
<httpHandlers>
<add path="CaptchaImage.axd" verb="GET" type="MSCaptcha.CaptchaImageHandler, MSCaptcha" />
</httpHandlers>
<!--
The <customErrors> section enables configuration
of what to do if/when an unhandled error occurs
during the execution of a request. Specifically,
it enables developers to configure html error pages
to be displayed in place of a error stack trace.
<customErrors mode="RemoteOnly" defaultRedirect="GenericErrorPage.htm">
<error statusCode="403" redirect="NoAccess.htm" />
<error statusCode="404" redirect="FileNotFound.htm" />
</customErrors>
-->
<pages controlRenderingCompatibilityVersion="3.5" clientIDMode="AutoID">
<controls>
<add assembly="AjaxControlToolkit" namespace="AjaxControlToolkit" tagPrefix="ajaxToolkit"/>
<add tagPrefix="cc1" assembly="MSCaptcha" namespace="MSCaptcha" />
</controls>
</pages>
</system.web>
<!--
The system.webServer section is required for running ASP.NET AJAX under Internet
Information Services 7.0. It is not necessary for previous version of IIS.
-->
<system.webServer>
<httpErrors errorMode="Detailed" />
<asp scriptErrorSentToBrowser="true"/>
<validation validateIntegratedModeConfiguration="false" />
</system.webServer>
<system.web>
<customErrors mode="Off"/>
<compilation debug="true"/>
</system.web>
<system.data>
<DbProviderFactories>
<remove invariant="MySql.Data.MySqlClient" />
<add name="MySQL Data Provider" invariant="MySql.Data.MySqlClient" description=".Net Framework Data Provider for MySQL" type="MySql.Data.MySqlClient.MySqlClientFactory, MySql.Data, Version=6.3.6.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d" />
</DbProviderFactories>
</system.data>
</configuration>
何が考えられますか?別の方法を試しましたが、まだ機能しません。