Форум администраторов игровых серверов

Форум администраторов игровых серверов (https://forum.zone-game.info/TT.php)
-   Программирование / Programming (https://forum.zone-game.info/forumdisplay.php?f=98)
-   -   c# entity framework (https://forum.zone-game.info/showthread.php?t=42438)

PROGRAMMATOR 28.12.2017 12:59

Re: c# entity framework
 
MySql.Data.Entity версии 6.10+?

Boris2105 28.12.2017 13:03

Re: c# entity framework
 
Цитата:

Сообщение от PROGRAMMATOR (Сообщение 429461)
MySql.Data.Entity версии 6.10+?

6.10.5

PROGRAMMATOR 28.12.2017 13:06

Re: c# entity framework
 
Попробуй понизить до 6.9.10 MySql.Data.Entity и MySQL Connector.

Boris2105 28.12.2017 13:31

Re: c# entity framework
 
Цитата:

Сообщение от PROGRAMMATOR (Сообщение 429463)
Попробуй понизить до 6.9.10 MySql.Data.Entity и MySQL Connector.

Понизил, теперь такая ошибка.
Код:

[Error] Формат строки инициализации не соответствует спецификации, начиная с индекса 0.
  в System.Data.Common.DbConnectionOptions.GetKeyValuePair(String connectionString, Int32 currentPosition, StringBuilder buffer, Boolean useOdbcRules, String& keyname, String& keyvalue)
  в System.Data.Common.DbConnectionOptions.ParseInternal(Hashtable parsetable, String connectionString, Boolean buildChain, Hashtable synonyms, Boolean firstKey)
  в System.Data.Common.DbConnectionOptions..ctor(String connectionString, Hashtable synonyms, Boolean useOdbcRules)
  в System.Data.Common.DbConnectionStringBuilder.set_ConnectionString(String value)
  в MySql.Data.MySqlClient.MySqlConnectionStringBuilder..ctor(String connStr)
  в MySql.Data.MySqlClient.MySqlConnection.set_ConnectionString(String value)
  в MySql.Data.MySqlClient.MySqlConnection..ctor(String connectionString)
  в MySql.Data.Entity.MySqlConnectionFactory.CreateConnection(String connectionString)
  в System.Data.Entity.Internal.LazyInternalConnection.Initialize()
  в System.Data.Entity.Internal.LazyInternalConnection.get_ProviderName()
  в System.Data.Entity.Internal.LazyInternalContext.get_ProviderName()
  в System.Data.Entity.Internal.DefaultModelCacheKeyFactory.Create(DbContext context)
  в System.Data.Entity.Internal.LazyInternalContext.InitializeContext()
  в System.Data.Entity.Internal.InternalContext.GetEntitySetAndBaseTypeForType(Type entityType)
  в System.Data.Entity.Internal.Linq.InternalSet`1.Initialize()
  в System.Data.Entity.Internal.Linq.InternalSet`1.get_InternalContext()
  в System.Data.Entity.Infrastructure.DbQuery`1.System.Linq.IQueryable.get_Provider()
  в System.Linq.Queryable.First[TSource](IQueryable`1 source, Expression`1 predicate)
  в PiercingBlow.Core.Database.AccountDB.loadAccount(String Token) в D:\Development\PiercingBlow\Server\Testing\PiercingBlow\PiercingBlow.Core\Database\AccountDB.cs:строка 13
  в PiercingBlow.Login.Emu.Network.Recv.PROTOCOL_LOGIN_REQ.RunImpl() в D:\Development\PiercingBlow\Server\Testing\PiercingBlow\PiercingBlow.Login\Emu\Network\Recv\PROTOCOL_LOGIN_REQ.cs:строка 29
  в PiercingBlow.Core.Packet.ClientPacket.Init(Byte[] buffer) в D:\Development\PiercingBlow\Server\Testing\PiercingBlow\PiercingBlow.Core\Packet\ClientPacket.cs:строка 22
  в PiercingBlow.Login.Emu.Network.ClientConnection.BeginRead(IAsyncResult asyncResult) в D:\Development\PiercingBlow\Server\Testing\PiercingBlow\PiercingBlow.Login\Emu\Network\ClientConnection.cs:строка 64


PROGRAMMATOR 28.12.2017 13:52

Re: c# entity framework
 
Приведи строку подключения.

Boris2105 28.12.2017 13:55

Re: c# entity framework
 
Код:

  <connectionStrings>
    <add name="testdb" providerName="MySql.Data.MySqlClient" connectionString="server=localhost;user id=Kirito;password=135635;database=testdb;persistsecurityinfo=True" />
  </connectionStrings>


PROGRAMMATOR 28.12.2017 14:05

Re: c# entity framework
 
Ну так вроде ничего необычного.

Давай содержимое всего файла.

Boris2105 28.12.2017 14:12

Re: c# entity framework
 
Вот


<?xml version="1.0" encoding="utf-8"?>
<configuration>
  <configSections>
    <!-- For more information on Entity Framework configuration, visit [url]http://go.microsoft.com/fwlink/?LinkID=237468[/url] -->
    <section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
  </configSections>
  <startup>
    <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5.2" />
  </startup>
  <!--MySql Configuration for EF 6-->
  <connectionStrings>
    <add name="testdb" providerName="MySql.Data.MySqlClient" connectionString="server=localhost;user id=Kirito;password=135635;database=testdb;persistsecurityinfo=True" />
  </connectionStrings>
  <entityFramework>
    <defaultConnectionFactory type="System.Data.Entity.Infrastructure.SqlConnectionFactory, EntityFramework" />
    <providers>
      <provider invariantName="MySql.Data.MySqlClient" type="MySql.Data.MySqlClient.MySqlProviderServices, MySql.Data.Entity.EF6" />
      <provider invariantName="System.Data.SqlClient" type="System.Data.Entity.SqlServer.SqlProviderServices, EntityFramework.SqlServer" />
    <provider invariantName="MySql.Data.MySqlClient" type="MySql.Data.MySqlClient.MySqlProviderServices, MySql.Data.Entity.EF6, Version=6.9.10.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d"></provider></providers>
  </entityFramework>
<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.9.10.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d" />
    </DbProviderFactories>
  </system.data></configuration>
 
Code: XML

PROGRAMMATOR 28.12.2017 14:34

Re: c# entity framework
 
Попробуй удалить дубль:

<provider invariantName="MySql.Data.MySqlClient" type="MySql.Data.MySqlClient.MySqlProviderServices, MySql.Data.Entity.EF6" />
 
Code: XML

Boris2105 28.12.2017 14:39

Re: c# entity framework
 
Цитата:

Сообщение от PROGRAMMATOR (Сообщение 429469)
Попробуй удалить дубль:

<provider invariantName="MySql.Data.MySqlClient" type="MySql.Data.MySqlClient.MySqlProviderServices, MySql.Data.Entity.EF6" />
 
Code: XML

Тоже самое , ошибка с индексом 0


Текущее время: 08:15. Часовой пояс GMT +3.

Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd. Перевод: zCarot