使いやすく、時間の節約になるという 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>
私はいくつかのことを試しました:
- 外部ツール パスで /config を使用して webconfig へのパスを指定します。
- サンプルに従って、6.0 .NET MySQL コネクタから最新の 5.2 バージョンにダウングレードします。
- SubSonic フォルダからそこにある DLL への参照として MySQL.Data を直接追加します。
- http://www.connectionstrings.com/mysql#28に基づいて、接続文字列のさまざまな形式を試す
(他の接続文字列: "Server=localhost;Database=config;Uid=user;Pwd=password;"- "blah" / "anything" も同じエラーをスローします...)
喜びはありません!SubSonicをあきらめるのに非常に近い。できれば助けてください!
ところで、Subsonic 2.2を使用しています