简体   繁体   English

错误:“此提供程序无法使用空间类型和功能”

[英]Error: “Spatial types and functions are not available for this provider”

I'm getting the error: 我收到错误:

Spatial types and functions are not available for this provider, because the assembly "Microsoft.SqlServer.Types" version 10 or higher could not be found. 空间类型和函数不适用于此提供程序,因为无法找到程序集“Microsoft.SqlServer.Types”版本10或更高版本。

I'm only getting this error on one of my dev machines - on the other, it works correctly. 我只在我的一台开发机器上出现此错误 - 另一方面,它正常工作。 Both machines have SQL Server 2014 installed on them, which ought to be enough, but apparently it's not. 两台机器都安装了SQL Server 2014,这应该足够了,但显然不是。 Beyond that, I've installed the nuget package "Microsoft.SqlServer.Types" in the solution (I've tried it in several of the subordinate projects as well), and have added the appropriate lines to load the DLLs in question: 除此之外,我在解决方案中安装了nuget包“Microsoft.SqlServer.Types”(我已经在几个从属项目中尝试过了),并添加了相应的行来加载有问题的DLL:

Utilities.LoadNativeAssemblies(AppDomain.CurrentDomain.BaseDirectory);

Debugging shows that the line in question executes, and stepping into it, it appears that the DLLs in question load successfully. 调试显示有问题的行执行,并进入它,似乎有问题的DLL加载成功。

The same machine used to run the project (a unit test assembly) without errors. 用于运行项目(单元测试组件)的相同机器没有错误。 The error started showing up about the same time that I switched the test project over to xUnit from MSTest, so it may very well be related to that. 错误开始出现的时候我将测试项目从MSTest切换到xUnit,所以它可能与此有关。

Any suggestions for troubleshooting this? 有任何疑难解答吗?

FWIW, I eventually managed to get this working by including the Microsoft.SqlServer.Types in every top-level project, including unit tests, and loading the DLLs via the LoadNativeAssemblies method separately in each top-level project. FWIW,我最终通过在每个顶级项目中包含Microsoft.SqlServer.Types(包括单元测试)以及在每个顶级项目中分别通过LoadNativeAssemblies方法加载DLL来LoadNativeAssemblies The documentation made no note of this, but it was the only thing I could come up with that worked. 文档没有记录这一点,但这是我能想到的唯一有用的东西。

降级到Microsoft.SqlServer.Types版本11.0.2对我有用。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 将应用程序移至服务器时,显示“空间类型和功能不适用于此提供程序”错误 - “Spatial types and functions are not available for this provider” error is showing when application moved to server 通过Massive ORM(ExecuteNonQuery),UdtTypeName错误更新具有空间数据类型的SQL Server 2008记录 - Updating SQL Server 2008 records w/spatial data types via Massive ORM (ExecuteNonQuery), UdtTypeName error 实体框架空间聚合函数 - Entity Framework Spatial Aggregates Functions Effort.EF6的空间DbGeography Provider异常[找不到可用的空间提供商。] - Spatial DbGeography Provider exception with Effort.EF6 [No usable spatial provider could be found.] 关于如何使用Npgsql空间类型的简单示例 - Simple example on how to use Npgsql spatial types 使用空间类型EF CORE创建模型 - Create a model Using Spatial types EF CORE Dapper支持空间类型.net核心 - Dapper Support Spatial Types .net Core 获取CoreCLR中的可用类型 - Get available types in CoreCLR 模棱两可的调用错误,两个函数具有不同的返回类型 - Ambiguous call error, both functions have different return types 是否在ObjectContext中没有DbContext函数? - Are there DbContext functions not available in ObjectContext?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM