MySQL& .NET:System.ArgumentException:初期化文字列の形式がインデックス0から始まる仕様に準拠していません

StackOverflow https://stackoverflow.com/questions/806435

  •  03-07-2019
  •  | 
  •  

質問

SubSonicは使いやすく時間の節約になると言っていたので、使いたかったです。

MySQLの接続文字列を正しく取得しようとして3時間後に、あきらめようとしています。

Building configuration from C:\Documents and Settings\user\My Documents\Visual Studio 2

008\Projects\ConfigurationItems\ConfigurationItemsMVC\Web.config
Adding connection to MySqlDataProvider
ERROR: Trying to execute generate
Error Message: System.ArgumentException: Format of the initialization string does not conform to specification starting at index 0.

これをシフトできません:エラーメッセージ:System.ArgumentException:初期化文字列の形式が、インデックス0から始まる仕様に準拠していません。

subsonic.exe / generateを実行しようとするたびに取得します

とても簡単に見える!!!

ここに私のWeb.Config

があります
<!-- connectionString="Persist Security Info=False;database=config;server=localhost;user id=config;Password=config" -->
  <connectionStrings>
    <remove name="ConfigConnectString"/>
    <add name="ConfigConnectString" connectionString="Persist Security Info=False;database=config;server=localhost;user id=userid;Password=password" providerName="MySql.Data.MySqlClient"
      />
    </connectionStrings>

  <SubSonicService defaultProvider="ConfigDatabase">
      <providers>
        <add type="SubSonic.MySqlDataProvider, SubSonic" 
             name="MySqlDataProvider" 
             generatedNamespace="Config" 
             connectionStringName="ConfigConnectString" 
             />

      </providers>
  </SubSonicService>

いくつかのことを試しました:

  1. 外部ツールパスで/ configを使用してwebconfigへのパスを指定します。
  2. 6.0 .NET MySQLコネクタからサンプルに沿った最新の5.2バージョンへのダウングレード。
  3. 参照としてMySQL.DataをSubSonicフォルダーからそこのDLLに直接追加します。
  4. http://www.connectionstrings.com/mysqlに基づいて、接続文字列のさまざまな形式を試す#28

(他の接続文字列:&quot; Server = localhost; Database = config; Uid = user; Pwd = password;&quot;-また&quot; blah&quot; /&quot; anything&quot;は同じエラーをスローします...)

喜びはありません! SubSonicをあきらめることに非常に近い。できるなら助けてください!

ところでSubsonic 2.2を使用しています

役に立ちましたか?

解決

私はバカです:

 <SubSonicService defaultProvider="ConfigDatabase">

はずです:

 <SubSonicService defaultProvider="MySqlDataProvider">

Doh!

他のヒント

どこかに ' {0} 'を期待していると思います。これは、忘れたときに発生するエラーです(IIRC)。

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top