MySQL和.NET:System.ArgumentException:初始化字符串的格式不符合从索引0开始的规范

leo*_*mig 2 .net asp.net subsonic

我想使用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.
Run Code Online (Sandbox Code Playgroud)

我无法转移它:错误消息: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>
Run Code Online (Sandbox Code Playgroud)

我尝试过几件事:

  1. 使用外部工具路径上的/ config指定webconfig的路径.
  2. 根据样本从6.0 .NET MySQL连接器降级到最新的5.2版本.
  3. 将MySQL.Data作为参考直接从SubSonic文件夹添加到那里的DLL.
  4. 根据http://www.connectionstrings.com/mysql#28尝试连接字符串的各种格式

(其他连接字符串:"Server = localhost; Database = config; Uid = user; Pwd = password;" - "blah"/"anything"会抛出相同的错误...)

没有快乐!非常接近放弃SubSonic.如果可以的话请帮忙!

顺便说一下,我使用的是Subsonic 2.2

leo*_*mig 7

我是个白痴:

 <SubSonicService defaultProvider="ConfigDatabase">
Run Code Online (Sandbox Code Playgroud)

应该:

 <SubSonicService defaultProvider="MySqlDataProvider">
Run Code Online (Sandbox Code Playgroud)

卫生署!