Could not load file or assembly 'Microsoft.SqlServer.Types even with Copy Local

Experienced the same issue, that has occured after upgrading of Visual Studio and Sql Server instances.

Problem has gone after reinstallation of SQLSysClrtypes.msi and ReportViewer.msi packages, that can be downloaded here

Hope it could help someone.


It's probably looking for one of its dependencies if you're sure the dll is in the bin folder.

Instead of referencing from the GAC have you tried removing the reference and adding the following NuGet package ?

https://www.nuget.org/packages/Microsoft.SqlServer.Types/


Same issue for me, however the problem was that the binding redirects in the app.config had not been updated to the new version. Usually updating the nuget package does it automatically, but this nuget package was in a referenced project. Simple fix:

<?xml version="1.0" encoding="utf-8"?>
<configuration>
  <appSettings />
  <startup> 
    <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5.2" />
  </startup>
  <runtime>
    <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
      <dependentAssembly>
        <assemblyIdentity name="Microsoft.SqlServer.Types" publicKeyToken="89845dcd8080cc91" culture="neutral" />
        <!-- <bindingRedirect oldVersion="0.0.0.0-11.0.0.0" newVersion="11.0.0.0" /> -->
        <bindingRedirect oldVersion="0.0.0.0-14.0.0.0" newVersion="14.0.0.0" />
      </dependentAssembly>
    </assemblyBinding>
  </runtime>
</configuration>

Tags:

C#

Reference