Assembly 'Microsoft.SqlServer.Types' version 10 or higher could not be found

后端 未结 4 2037
谎友^
谎友^ 2020-12-05 04:48

I Have a problem. I\'m not able to add a Migration to my ASP.NET WebAPI 2 Project. I get error:

\"Spatial types and functions are not available for t

相关标签:
4条回答
  • 2020-12-05 05:10

    After a lot of research I just installed "Microsoft System CLR Types for SQL Server 2012" from:

    • X86 - http://go.microsoft.com/fwlink/?LinkID=239643&clcid=0x409
    • X64 - http://go.microsoft.com/fwlink/?LinkID=239644&clcid=0x409

    Worked like a charm!

    0 讨论(0)
  • 2020-12-05 05:12

    the problem may be "virtual". You need to have SqlServerSpatial140.dll in bin folder at the moment you issue add-migration command. Just copy the .dll to bin for development purpose and replace manually the version (x86/x64) during deployment. Sql Server (2012+) already has the assembly installed.

    0 讨论(0)
  • 2020-12-05 05:16

    Make sure you are not missing a binding redirect

      <dependentAssembly>
          <assemblyIdentity name="Microsoft.SqlServer.Types" publicKeyToken="89845dcd8080cc91" culture="neutral" />
          <bindingRedirect oldVersion="10.0.0.0-11.0.0.0" newVersion="14.0.0.0" />
        </dependentAssembly>
    
    0 讨论(0)
  • 2020-12-05 05:36

    This worked for me.

    Add this to the web.config > system.webServer >> runtime >> assemblyBinding node

      <dependentAssembly>
        <assemblyIdentity name="Microsoft.SqlServer.Types" publicKeyToken="89845dcd8080cc91" culture="neutral" />
        <bindingRedirect oldVersion="0.0.0.0-14.0.0.0" newVersion="14.0.0.0" />
      </dependentAssembly>
    
    0 讨论(0)
提交回复
热议问题