{"id":6472,"date":"2014-04-18T06:52:18","date_gmt":"2014-04-18T06:52:18","guid":{"rendered":"https:\/\/unknownerror.org\/index.php\/2014\/04\/18\/mysql-connector-6-7-4-and-entity-framework-5-exceptions-collection-of-common-programming-errors-2\/"},"modified":"2014-04-18T06:52:18","modified_gmt":"2014-04-18T06:52:18","slug":"mysql-connector-6-7-4-and-entity-framework-5-exceptions-collection-of-common-programming-errors-2","status":"publish","type":"post","link":"https:\/\/unknownerror.org\/index.php\/2014\/04\/18\/mysql-connector-6-7-4-and-entity-framework-5-exceptions-collection-of-common-programming-errors-2\/","title":{"rendered":"MySQL connector 6.7.4 and Entity Framework 5 exceptions-Collection of common programming errors"},"content":{"rendered":"<p>The trick to solving this was:<\/p>\n<ol>\n<li>Add references to the <code>MySql.Data<\/code> and <code>MySql.Data.Entity<\/code> libraries of the correct version (6.7.4.0 for .NET 4.5, in my case) to the project.<\/li>\n<li>Edit <code>machine.config<\/code> with your editor run as administrator, and replace all occurences of MySQL version <code>6.6.5.0<\/code> by <code>6.7.4.0<\/code>.<\/li>\n<\/ol>\n<p>For the second step, note that there are multiple <code>machine.config<\/code> files, one for each framework version (3.0, 3.5, 4.0) and architecture (32-bit, 64-bit). Also note that the <code>machine.config<\/code> file for .NET 4.5 is in the .NET 4.0 folder. You can find the <code>machine.config<\/code> files in:<\/p>\n<blockquote>\n<p>C:\\Windows\\Microsoft.NET\\Framework\\\\Config<\/p>\n<\/blockquote>\n<p>And:<\/p>\n<blockquote>\n<p>C:\\Windows\\Microsoft.NET\\Framework64\\\\Config<\/p>\n<\/blockquote>\n<p>If there are no references to MySQL in the <code>machine.config<\/code> file, you might not have installed MySQL for Visual Studio. Either do that, or add the following to the <code>app.config<\/code> file of your project:<\/p>\n<pre><code>\n    \n        \n    \n\n<\/code><\/pre>\n<p>Note however, that when you both install <code>MySQL for Visual Studio<\/code> <em>and<\/em> add the above snippet to your <code>app.config<\/code> file, then you&#8217;ll get this exception:<\/p>\n<blockquote>\n<p><strong>ConfigurationErrorsException<\/strong>: Column &#8216;InvariantName&#8217; is constrained to be unique. Value &#8216;MySql.Data.MySqlClient&#8217; is already present.<\/p>\n<\/blockquote>\n","protected":false},"excerpt":{"rendered":"<p>The trick to solving this was: Add references to the MySql.Data and MySql.Data.Entity libraries of the correct version (6.7.4.0 for .NET 4.5, in my case) to the project. Edit machine.config with your editor run as administrator, and replace all occurences of MySQL version 6.6.5.0 by 6.7.4.0. For the second step, note that there are multiple [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-6472","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/6472","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/comments?post=6472"}],"version-history":[{"count":0,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/6472\/revisions"}],"wp:attachment":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/media?parent=6472"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/categories?post=6472"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/tags?post=6472"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}