0

ウェブサイトをウェブホストに公開しましたが、深刻なデータベースの問題がいくつかあります。これは私のエラーです

Description: 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: The connection name 'LocalSqlServer' was not found in the applications configuration or the connection string is empty.

Line 255:            <providers>
Line 256:                <add name="AspNetSqlMembershipProvider"
Line 257:                    type="System.Web.Security.SqlMembershipProvider, System.Web, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"
Line 258:                    connectionStringName="LocalSqlServer"
Line 259:                    enablePasswordRetrieval="false"
Source File: C:\Windows\Microsoft.NET\Framework\v4.0.30319\Config\machine.config    Line: 257 

これは私のホストへの接続文字列です:

<connectionStrings>
    <remove name="LocalSqlServer" />
    <add name="SiteSqlServer" connectionString="Server=(localhost);Database=ulprojec_******-***;uid=ulprojec_***;pwd=********a;" />   

</connectionStrings>

これは、Microsoft の Web サイトから取得したメンバーシップ接続文字列ですが、それでも最初のエラーが発生します。

<membership defaultProvider="SiteSqlServer"
      userIsOnlineTimeWindow="15">
      <providers>
        <add 
          name="SiteSqlServer" 
          type="System.Web.Security.SqlMembershipProvider" 
          connectionStringName="SiteSqlServer"
          applicationName="georgi-it"
          enablePasswordRetrieval="false"
          enablePasswordReset="true"
          requiresQuestionAndAnswer="true"
          requiresUniqueEmail="false"
          passwordFormat="Hashed"
          maxInvalidPasswordAttempts="5"
          passwordAttemptWindow="10" />
      </providers>
    </membership>

私はすでに必死になっているので、本当に本当に本当に感謝しています。

編集:私はこれを整理しました

私は今この問題を抱えています:

Exception Details: System.ArgumentException: Invalid value for key 'attachdbfilename'.

Source Error: 

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
4

2 に答える 2

1

エラーが受信したものである場合、これは、次の部分で接続文字列「LocalSqlServer」を使用していることを意味します。

<providers>
Line 256:                <add name="AspNetSqlMembershipProvider"
Line 257:                    type="System.Web.Security.SqlMembershipProvider, System.Web, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"
**Line 258:                    connectionStringName="LocalSqlServer"**
Line 259:                    enablePasswordRetrieval="false"

ここでは、接続文字列を削除しています。

<connectionStrings>
    **<remove name="LocalSqlServer" />**
    <add name="SiteSqlServer" connectionString="Server=(localhost);Database=ulprojec_******-***;uid=ulprojec_***;pwd=********a;" />   

</connectionStrings>

接続文字列に単純な名前付けの問題があることがわかると思います。

于 2013-03-12T00:02:48.020 に答える
0

メンバーシップ機能を使用していない場合は、ルート web.cofig ファイルの system.web セクションからメンバーシップ、プロファイル、および roleManager タグを削除します。これは問題を解決するのに役立ちました。

于 2016-01-29T12:58:59.393 に答える