2017-11-09 17 views
0

새 MySql 데이터베이스 연결을 추가하려고합니다. 내 버전의 MySql.Data는 6.9.9.0이며 내 EFModel 프로젝트의 app.config 및 프로젝트의 Nuget Package Manager에서이 버전으로 참조됩니다. 나는 그것을 테스트 할 때Eroor 새 데이터베이스 연결을 추가 할 때 "파일을로드 할 수 없거나 MySql.data를 어셈블리 할 수 ​​없습니다."

, 내 서버와의 연결이 잘 확립되어 있지만 내가 클릭하면 "OK"는 오류를 표시합니다

문제는이 버전이 내 솔루션에 쓴되지 않는 것을

"Could not load file or assembly 'MySql.data, Version=6.9.8.0, Culture=Neutral, PublicKeyToken=BigNumber' or one of his dependencies. The found definition of the assembly's manifest doesn't correspond to the reference of the assembly."

모든 설정 파일에서.

<?xml version="1.0" encoding="utf-8"?> 
<configuration> 
    <configSections> 
    <section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" /> 

    <!-- For more information on Entity Framework configuration, visit http://go.microsoft.com/fwlink/?LinkID=237468 --></configSections> 
    <entityFramework codeConfigurationType="MySql.Data.Entity.MySqlEFConfiguration, MySql.Data.Entity.EF6"> 
    <defaultConnectionFactory type="System.Data.Entity.Infrastructure.SqlConnectionFactory, EntityFramework" /> 
    <providers> 
     <provider invariantName="MySql.Data.MySqlClient" type="MySql.Data.MySqlClient.MySqlProviderServices, MySql.Data.Entity.EF6" /> 
    </providers> 
    </entityFramework> 
    <connectionStrings> 
    <add name="UphairDbEntities" connectionString="metadata=res://*/DbModel.csdl|res://*/DbModel.ssdl|res://*/DbModel.msl;provider=MySql.Data.MySqlClient;provider connection string=&quot;server=***;user id=***;password=***;database=***&quot;" providerName="Mysql.Data.MysqlClient" /> 
    </connectionStrings> 
    <startup> 
    <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5" /> 
    </startup> 
    <system.data> 
    <DbProviderFactories> 
     <remove invariant="MySql.Data.MySqlClient" name="MySQL Data Provider" /> 
     <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.9.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d" /> 
    </DbProviderFactories> 
    </system.data> 
    <runtime> 
    <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1"> 
     <dependentAssembly> 
     <assemblyIdentity name="MySql.Data" publicKeyToken="c5687fc88969c44d" culture="neutral" /> 
     <bindingRedirect oldVersion="0.0.0.0-6.8.3.0" newVersion="6.8.3.0" /> 
     </dependentAssembly> 
     <dependentAssembly> 
     <assemblyIdentity name="EntityFramework" publicKeyToken="b77a5c561934e089" culture="neutral" /> 
     <bindingRedirect oldVersion="0.0.0.0-6.0.0.0" newVersion="6.0.0.0" /> 
     </dependentAssembly> 
    </assemblyBinding> 
    </runtime> 
</configuration> 

나는 3 일 동안의 사투를 벌인거야하지만 내가 찾은 모든 문제가 아니었다 이후 SO 또는 인터넷에서 모든 솔루션 또는 관련 문제를 찾을 수 없습니다 : 여기

내 app.config 파일입니다 필자의 경우 app.config에 나열되지 않은 오류에 표시되는 버전이나 데이터베이스에 대한 새 연결을 추가하는 방법에 대해 설명합니다. 나는 이것을 일으킬 수있는 것을 정말로 이해하지 못합니다.

도와주세요! :/

+0

. 단지 다음과 같습니다 : MySql.Data.MySqlClient.MySqlProviderServices, MySql.Data.Entity, Version = 6.10.5.0, Culture = neutral, PublicKeyToken = c5687fc88969c44d 실제 오류 메시지가 없습니다. 프로젝트 이름과 파일입니다. 이것은 Visual Studio의 최신 버전에서 상당히 일반적인 것으로 보입니다 : 문제 자체를 실제로 진단하는 데 도움이되는 것보다는 문제의 증상과 관련된 "오류"를 제공하십시오. 내 경우에는 EF와 함께 MySql을 사용하여 기존 데이터베이스에서 데이터를 검색하여 마이 그 레이션합니다. –

+0

몇 가지 추가 온라인 조사를 통해 내 문제의 가능한 원인은 두 가지로 나타났습니다. (1) Entity Framework 6.2에서 문제가 발생했습니다. (2) 그것이 MySql.Data v6.10.5 및/또는 MySql.Data.Entity v6.10.5와 함께 있음을 나타냅니다. 두 버전의 버전을 변경하여 실험 한 결과, 이제는 후자의 경우를 입증했습니다. EF를 6.1로 낮추고 MySql DLL을 v6.10.5 (또는 6.10.4)로두면 소프트웨어가 작동하지 않습니다. 그러나 두 MySql 패키지를 모두 6.9.10으로 다운 그레이드하면 EF 6.1 또는 6.2가 포함 된 작업 솔루션을 얻을 수있었습니다. –

+0

그러나 VS 오류에 관한 나의 요점은. 나는 지난 1 년 동안 많은 일들을 보았습니다. 일이 생기거나 전개되지 않을 때 나오는 오류가 문제의 근본적인 원인을 진단하는 데 도움이되지 않는 곳에서는 많은 경우가있었습니다. 구글과 스택 오버 플로우 (stackoverflow)와 같은 사이트가 아니라면, 나는 단서가 전혀없는, 완전히 바다에있는 경우가 많다. 이것은 많은 비용을들이는 IDE를 위해 좋은 곳이 아닙니다. –

답변

0

Conflicting versions of MySql.Data.dll in .Net project not allowing me to add/edit TableAdapters in my DataSets

난 그냥 내 대답의 상단에있는 중복 링크에 설명 된대로 다음 6.9.8.0 버전을 설치 MySQL의 커넥터 6.9.10를 제거했고 나는 새를 추가했다하지 않았다 [DUPLICATE] 연결, 두 개의 연결된 프로젝트에 대한 내 기지가 잘 표시되었습니다!

MySql Connector의 이전 버전에 대한이 링크는 나에 따르면 발견 된 엉덩이에 통증이 있습니다!

하지만 지금, 그래서 안심이 어떤 다른 사람을 도울 수있는 희망 : 그것은 가치가 내가 내 솔루션을 빌드 할 때, 나는 더 적은 도움이 오류를 받고 있어요 들어 D

0

많이 검색하지 않아도됩니다. 로드하려는 어셈블리가 application.config 파일에서 참조 된 버전과 일치하지 않는다고 알려줍니다.

여기에 다른 질문을 참조하십시오 :

The .NET Assembly loader is unable to find 1.2.0.203, but did find a 1.2.0.200. This assembly does not match what was requested and therefore you get this error. In simple words, it can't find the assembly that was referenced. Make sure it can find the right assembly by putting it in the GAC or in the application path.

The located assembly's manifest definition does not match the assembly reference

이것은 또한 다른 대답에 연결되어 있습니다 The located assembly’s manifest definition with name xxx.dll does not match the assembly reference

희망을.

+0

첫 번째 게시물에서 말했듯이 이것은로드하려고하는 좋은 버전이 아니며이 버전은 내 config 파일 중 하나가 아니므로 내 app.config에서 볼 수 있습니다. 첫 번째 게시물. 나는 visual studio가 6.9.9.0을로드하기를 원하고, 어떤 명백하지 않은 이유로 6.9.8.0을로드하려고한다. 어떤 생각? –

+0

나는 그것을 전혀 참조하지 않았 음을 알고 계십니까? Visual Studio 나 글로벌 어셈블리 캐시에서 참조를 확인할 수 있습니까? 어딘가에서 잘못된 버전을 가져와야합니다. 관심사에서, 당신은 과거에 6.9.8.0을 사용 했습니까? 또한 "bin"및 "obj"폴더를 확인하고 지 웁니다. –

+0

bin 및 proj 디렉토리는 어디에 있습니까? –