无法加载SqlServerSpatial.dll [英] Unable to load SqlServerSpatial.dll

查看:174
本文介绍了无法加载SqlServerSpatial.dll的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试在C#.Net项目中使用SqlServer Spatial CLR类型。
我想使用SqlGeometry查询数据库中的空间记录。



我在运行Visual Studio 2010的单元测试中在本地计算机上进行此操作击中远程SqlServer计算机。一切都很好。



然后,我将WCF Rest服务发布到我的本地IIS实例,该实例具有与单元测试命中相同类库的服务,以进行一些空间查询和



我收到一条错误消息


无法加载DLL SqlServerSpatial .dll:找不到指定的模块


我已经在Google上搜索并找到了很多答案-没有为我工作。
我有:




  • 在GAC中注册了CLR类型

  • 安装64位,以及后来的VC ++ 32位版本

  • 尝试了使用不同Microsoft.SqlServer.Types dll版本



  • 我唯一没有做过并且坦率地拒绝做的事情是在实际的SqlServer框上安装任何东西。这对我来说似乎是不必要的。



    在这一点上,我唯一能想到的就是权限问题,因为它运行在IIS应用程序池中,而不是在Studio中运行的,



    请注意,在我的项目中,我从不引用错误消息中提到的dll。该dll存在于sql框中,但我无法将其添加到studio,因为它在我尝试输入时会给出一些消息。
    我已经用光了这里的东西。这是90年代的dll地狱。

    解决方案

    我在Windows Server 2012计算机上遇到了同样的问题。 \Windows\System32中它具有SqlServerSpatial110.dll文件,但没有SqlServerSpatial.dll。解决方案是在计算机上安装SQL Server 2008 R2的Microsoft系统CLR类型。


    1. http://www.microsoft.com/en-us/download/details.aspx?id=26728

    2. 单击下载

    3. 选中其中一个,具体取决于您的处理器体系结构:




      • 1033\ x64 \SQLSysClrTypes.msi

      • 1033\ x86 \SQLSysClrTypes.msi

      • 1033\ IA64 \SQLSysClrTypes.msi


    4. 单击下一步



    I am trying to use the SqlServer Spatial CLR types in a C# .Net project. I want to use SqlGeometry to query spatial records out of my db.

    I have this working on my local machine in a unit test running in Visual Studio 2010 hitting a remote SqlServer machine. All good.

    I then publish a WCF Rest service to my local IIS instance that has a service that hits the same class library as the unit test to do some spatial querying and it fails.

    I get an error saying

    Unable to load DLL SqlServerSpatial.dll : The specified module could not be found.

    I have googled this and found many, many answers - none work for me. I have:

    • registered the CLR types with the GAC
    • install the 64-bit, and later also, the 32-bit version of the VC++
    • tried many variations of using different Microsoft.SqlServer.Types dll versions

    The only thing I have not done, and frankly refuse to do, is to install anything on the actual SqlServer box. This seems unnecessary to me.

    At this point the only thing that I can think is causing this is a permissions issue because it is running in an IIS app pool and not inside Studio where it works in the unit test.

    Note that in my project I NEVER make reference to the dll mentioned in the error message. That dll is present on the sql box but I can't add it to studio as it gives some message when i try to. I'm running out of things to try here. It's 90's dll hell all over again.

    解决方案

    I had the same problem on a Windows Server 2012 machine. It had an SqlServerSpatial110.dll file in \Windows\System32, but no SqlServerSpatial.dll. The solution was installing 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

    这篇关于无法加载SqlServerSpatial.dll的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆