Error:
An unhandled exception of type 'System.IO.FileLoadException' occurred in WindowsFormsApplication4.exe
Additional information: Could not load file or assembly 'MySql.Data, Version=8.0.8.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d' or one of its dependencies. Strong name validation failed. (Exception from HRESULT: 0x8013141A)
Information:
Problem:
I've made a class library using MySQL to run various queries to my online database.
After including the dll in my separate project, the only line of code I'm using is the following: (which it throws the exception on)
// Runs a simple select statement to find matches for 'John Doe' in my online MySQL database table... and stores results to a dataset
DataSet ds = MyDllNameSpace.Database.People.Load("John", "Doe");
App.Config files:
My dll project: (I did NOT sign this project)
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<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=8.0.8.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d" />
</DbProviderFactories>
</system.data></configuration>
My separate project: (I did NOT sign this project)
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5.2" />
</startup>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="MySql.Data" publicKeyToken="c5687fc88969c44d" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-8.0.8.0" newVersion="8.0.8.0" />
</dependentAssembly>
</assemblyBinding>
</runtime>
</configuration>
What I've searched/tried:
Thank you
Have you tried signing the project(s)? That may remove your error.
Maybe this link about your error will help: https://blogs.msdn.microsoft.com/keithmg/2012/03/20/strong-name-validation-failed-exception-from-hresult-0x8013141a/
or this stackoverflow question: Strong Name Validation Failed
User contributions licensed under CC BY-SA 3.0