Unable to load DLL 'SqlServerSpatial.dll'

前端 未结 7 2045
谎友^
谎友^ 2020-12-01 20:48

I have a .NET MVC web application referencing System.Data.Spatial so I can use the DbGeography datatype on a property for some geolocation stuff. I

相关标签:
7条回答
  • 2020-12-01 21:28
    • SqlGeometry and SqlGeography types can be used in VS projects (e.g. C#) by referencing the Microsoft.SqlServer.Types.dll.
    • Microsoft.SqlServer.Types.dll is a managed library and has some unmanaged library as prerequisites and they are like SqlServerSpatialXXX.dll and msvcrXXX.dll
    • Since Sql Server 2008, different versions of Microsoft.SqlServer.Types.dll are available, however, I don't see any functionality change from 2012 on.

    For a detailed solution you may want to see my answer on another similar post.

    0 讨论(0)
  • 2020-12-01 21:31

    SQL 2012 installs this dll too, SQL 2014 don't! You have to install the Microsoft System CLR Types for SQL Server 2008 R2 on the machine.

    1. http://www.microsoft.com/en-us/download/details.aspx?id=26728
    2. Click Download
    3. Check off one of these depending on your processor architecture:

      • 1033\x64\SQLSysClrTypes.msi
      • 1033\x86\SQLSysClrTypes.msi
      • 1033\IA64\SQLSysClrTypes.msi
    4. Click Next

    Edit

    as Ian Grainger's comment, you have to install the correct version based on your IIS. apparently IIS Express runs in 32bit mode by default.

    0 讨论(0)
  • 2020-12-01 21:32
    <runtime>
      <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
      <dependentAssembly>
      <assemblyIdentity name="Microsoft.SqlServer.Types" 
      publicKeyToken="89845dcd8080cc91" culture="neutral" />
      <bindingRedirect oldVersion="10.0.0.0" newVersion="12.0.0.0" />
      </dependentAssembly>
      </assemblyBinding>
    </runtime>
    
    0 讨论(0)
  • 2020-12-01 21:42

    I ran into this problem and was truly missing the SqlServerSpatial110.dll

    I ended up following the instructions here:

    http://dllyes.com/sqlserverspatial110-dll/

    Basically you need to get your hands on that .dll and then

    Place SqlServerSpatial110.dll in \Windows\System32 (usually located at disk C) if you’re running 32 bit Windows. If you’are running 64 bit Windows, additionally place file in \Windows\SysWOW64.

    0 讨论(0)
  • 2020-12-01 21:43
    I had the same issue in godaddy VPS with windows server 2012 r2
    

    I Resolved it by Updating my EF5 to EF6

    in package manager console run to EF5 to EF lalest

    Install-Package EntityFramework 
    
    0 讨论(0)
  • 2020-12-01 21:50

    SqlServerSpatial.dll is unmanaged code. You have to install the correct version (64bit) on the server. Add the DLL to your project. Set the properties of SqlServerSpatial110.dll to “Copy to Output directory = Copy always”

    You find detailed Information here

    0 讨论(0)
提交回复
热议问题