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'm using Visual Studio 2012 with .NET 4.5 and do not have a full installation of SQL Server on my development machine (only localdb).
我有一个引用System.Data.Spatial的.NET MVC Web应用程序,所以我可以在属性上使用DbGeography数据类型来处理某些地理位置。我正在使用Visual Studio 2012和.NET 4.5,并且在我的开发机器上没有完整的SQL Server安装(只有localdb)。
The app works great until I push it to Azure. As soon as my app hits my DbGeography
property, it throws this error:
该应用程序运行良好,直到我将其推送到Azure。只要我的应用程序访问我的DbGeography属性,它就会抛出此错误:
Unable to load DLL 'SqlServerSpatial.dll': The specified module could not be found.
无法加载DLL“SqlServerSpatial.dll”:找不到指定的模块。
Has anyone else encountered this issue?
还有其他人遇到过这个问题吗?
6 个解决方案
#1
12
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”
SqlServerSpatial.dll是非托管代码。您必须在服务器上安装正确的版本(64位)。将DLL添加到项目中。将SqlServerSpatial110.dll的属性设置为“复制到输出目录=始终复制”
You find detailed Information here
您可在此处找到详细信息
#2
0
I ran into this problem and was truly missing the SqlServerSpatial110.dll
我遇到了这个问题,并且真的错过了SqlServerSpatial110.dll
I ended up following the instructions here:
我最后按照这里的说明操作:
http://dllyes.com/sqlserverspatial110-dll/
http://dllyes.com/sqlserverspatial110-dll/
Basically you need to get your hands on that .dll and then
基本上你需要得到那个.dll然后
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.
如果您运行的是32位Windows,请将SqlServerSpatial110.dll放在\ Windows \ System32(通常位于磁盘C)中。如果您运行的是64位Windows,则另外将文件放在\ Windows \ SysWOW64中。
#3
0
-
SqlGeometry
andSqlGeography
types can be used in VS projects (e.g. C#) by referencing theMicrosoft.SqlServer.Types.dll
. - 可以通过引用Microsoft.SqlServer.Types.dll在VS项目(例如C#)中使用SqlGeometry和SqlGeography类型。
-
Microsoft.SqlServer.Types.dll
is a managed library and has some unmanaged library as prerequisites and they are likeSqlServerSpatialXXX.dll
andmsvcrXXX.dll
- Microsoft.SqlServer.Types.dll是一个托管库,并且有一些非托管库作为先决条件,它们就像SqlServerSpatialXXX.dll和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. - 从Sql Server 2008开始,可以使用不同版本的Microsoft.SqlServer.Types.dll,但是从2012年开始我没有看到任何功能更改。
For a detailed solution you may want to see my answer on another similar post.
有关详细解决方案,您可能希望在另一篇类似的帖子中看到我的答案。
#4
0
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.
SQL 2012也安装了这个dll,SQL 2014没有!您必须在计算机上安装SQL Server 2008 R2的Microsoft系统CLR类型。
- http://www.microsoft.com/en-us/download/details.aspx?id=26728
- http://www.microsoft.com/en-us/download/details.aspx?id=26728
- Click Download
- 单击下载
-
Check off one of these depending on your processor architecture:
根据您的处理器架构检查其中一个:
- 1033\x64\SQLSysClrTypes.msi
- 1033 \ 64 \ SQLSysClrTypes.msi
- 1033\x86\SQLSysClrTypes.msi
- 1033 \ 86 \ SQLSysClrTypes.msi
- 1033\IA64\SQLSysClrTypes.msi
- 1033 \ IA64 \ SQLSysClrTypes.msi
-
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.
作为Ian Grainger的评论,你必须根据你的IIS安装正确的版本。显然,IIS Express默认以32位模式运行。
#5
0
I had the same issue in godaddy VPS with windows server 2012 r2
I Resolved it by Updating my EF5 to EF6
我通过将EF5更新为EF6来解决它
in package manager console run to EF5 to EF lalest
在包管理器控制台中运行到EF5到EF lalest
Install-Package EntityFramework
#6
0
<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>
#1
12
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”
SqlServerSpatial.dll是非托管代码。您必须在服务器上安装正确的版本(64位)。将DLL添加到项目中。将SqlServerSpatial110.dll的属性设置为“复制到输出目录=始终复制”
You find detailed Information here
您可在此处找到详细信息
#2
0
I ran into this problem and was truly missing the SqlServerSpatial110.dll
我遇到了这个问题,并且真的错过了SqlServerSpatial110.dll
I ended up following the instructions here:
我最后按照这里的说明操作:
http://dllyes.com/sqlserverspatial110-dll/
http://dllyes.com/sqlserverspatial110-dll/
Basically you need to get your hands on that .dll and then
基本上你需要得到那个.dll然后
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.
如果您运行的是32位Windows,请将SqlServerSpatial110.dll放在\ Windows \ System32(通常位于磁盘C)中。如果您运行的是64位Windows,则另外将文件放在\ Windows \ SysWOW64中。
#3
0
-
SqlGeometry
andSqlGeography
types can be used in VS projects (e.g. C#) by referencing theMicrosoft.SqlServer.Types.dll
. - 可以通过引用Microsoft.SqlServer.Types.dll在VS项目(例如C#)中使用SqlGeometry和SqlGeography类型。
-
Microsoft.SqlServer.Types.dll
is a managed library and has some unmanaged library as prerequisites and they are likeSqlServerSpatialXXX.dll
andmsvcrXXX.dll
- Microsoft.SqlServer.Types.dll是一个托管库,并且有一些非托管库作为先决条件,它们就像SqlServerSpatialXXX.dll和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. - 从Sql Server 2008开始,可以使用不同版本的Microsoft.SqlServer.Types.dll,但是从2012年开始我没有看到任何功能更改。
For a detailed solution you may want to see my answer on another similar post.
有关详细解决方案,您可能希望在另一篇类似的帖子中看到我的答案。
#4
0
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.
SQL 2012也安装了这个dll,SQL 2014没有!您必须在计算机上安装SQL Server 2008 R2的Microsoft系统CLR类型。
- http://www.microsoft.com/en-us/download/details.aspx?id=26728
- http://www.microsoft.com/en-us/download/details.aspx?id=26728
- Click Download
- 单击下载
-
Check off one of these depending on your processor architecture:
根据您的处理器架构检查其中一个:
- 1033\x64\SQLSysClrTypes.msi
- 1033 \ 64 \ SQLSysClrTypes.msi
- 1033\x86\SQLSysClrTypes.msi
- 1033 \ 86 \ SQLSysClrTypes.msi
- 1033\IA64\SQLSysClrTypes.msi
- 1033 \ IA64 \ SQLSysClrTypes.msi
-
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.
作为Ian Grainger的评论,你必须根据你的IIS安装正确的版本。显然,IIS Express默认以32位模式运行。
#5
0
I had the same issue in godaddy VPS with windows server 2012 r2
I Resolved it by Updating my EF5 to EF6
我通过将EF5更新为EF6来解决它
in package manager console run to EF5 to EF lalest
在包管理器控制台中运行到EF5到EF lalest
Install-Package EntityFramework
#6
0
<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>