title: Error 0x80131047 loading MySQL Connector DLL
body: <p>PowerShell has just been opened sourced (v6.0.0-alpha.10), and I'm
  trying to get it to connect to a MySQL instance from OS X.</p>
  
  <p>Oracle seems to suggest (if I'm reading it correctly) that they have a
  .Net Core connector
  <a href="https://blogs.oracle.com/MySqlOnWindows/entry/connector_net_6_8_3" rel="nofollow noreferrer">here</a>.
  I ran the install like this:</p>
  
  <pre><code>Install-Package MySql.ConnectorNET.Entity -Destination /MySQL
  </code></pre>
  
  <p>and the output looked good:</p>
  
  <pre>Name                       Version Source Summary                
  
  ----                       ------- ------ ------- 
  MySql.ConnectorNET.Data    6.8.3.2 nugget ADO.Net driver for MySQL    
  MySql.ConnectorNET.Entity  6.8.3.2 nugget MySql Connector/NET for Entity Framework 6</pre>
  
  <p>When I try loading the assembly like this:</p>
  
  <pre><code>[System.Reflection.Assembly]::Load(/MySQL/MySql.ConnectorNET.Data.6.8.3.2/lib/net45/MySql.Data.dll)
  </code></pre>
  
  <p>I get the following error (note that I pass the path in with a
  variable <code>$dll</code>):</p>
  
  <pre>Exception calling "Load" with "1" argument(s): "Could not load
  file or assembly
  '/MySQL/MySql.ConnectorNET.Entity.6.8.3.2/lib/net40/MySql.Data.dll,
  Culture=neutral, PublicKeyToken=null'. The given assembly name or
  codebase was invalid. (Exception from HRESULT: 0x80131047)" At
  /development/scripts/test.ps1:28 char:1
  + [System.Reflection.Assembly]::Load("$dll")
  + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      + CategoryInfo          : NotSpecified: (:) [], MethodInvocationException
      + FullyQualifiedErrorId : FileLoadException</pre>
  
  <p>Any ideas on a workaround / fix? I realize that PowerShell is still in
  alpha.</p>
  
  <p><strong>EDIT</strong></p>
  
  <p>I was able to install the MySQL provider using these two commands:</p>
  
  <pre><code>Register-PackageSource -Name nuget.org -ProviderName NuGet -Location https://www.nuget.org/api/v2/
  Install-Package MySql.Data.EntityFrameworkCore -Destination /Volumes/Main/libraries/MySQL/ -AllowPrereleaseVersions
  </code></pre>
  
  <p>I tried registering all the assemblies I could think of:</p>
  
  <pre>
  Microsoft.EntityFrameworkCore.1.0.1/lib/netstandard1.3/Microsoft.EntityFrameworkCore.dll
  Microsoft.Extensions.Configuration.1.0.0/lib/netstandard1.1/Microsoft.Extensions.Configuration.dll
  Microsoft.Extensions.Configuration.Json.1.0.0/lib/netstandard1.3/Microsoft.Extensions.Configuration.Json.dll
  MySql.Data.EntityFrameworkCore.7.0.5-IR21/lib/netstandard1.6/MySql.Data.EntityFrameworkCore.dll
  MySql.Data.7.0.5-IR21/lib/netstandard1.6/MySql.Data.dll </pre>
  
  <p>But, when trying to create a new MySql object, it still bombs out with
  this:</p>
  
  <blockquote>
    <p>New-Object : Cannot find type [MySql.Data.MySqlClient]:
    verify that the assembly containing this type is loaded.</p>
  </blockquote>