【问题标题】:Spatial types and functions are not available for this provider because the assembly 'Microsoft.SqlServer.Types'此提供程序无法使用空间类型和函数,因为程序集“Microsoft.SqlServer.Types”
【发布时间】:2018-08-16 22:18:16
【问题描述】:

Windows 最近蓝屏并自行重新安装。结果我不得不重新安装我所有的开发工具。我有 VS 2015,现在正在使用 VS 2017

我在尝试运行以前可以运行的 .NET 4.6 Web 应用程序时遇到此错误

空间类型和功能不适用于此提供程序 因为程序集Microsoft.SqlServer.Types 版本 10 或更高 找不到。

我在网上找到的解决方法是运行

Install-Package Microsoft.SqlServer.Types

该包包含说明: ASP.NET 应用程序 对于 ASP.NET 应用程序,在Global.asax.cs 中的Application_Start 方法中添加以下代码行:SqlServerTypes.Utilities.LoadNativeAssemblies(Server.MapPath("~/bin"));

我试图将该行添加到我的Global.asax.vb(这是 vb.net 项目) Intellisense 用红色强调 SqlServerTypes 并且不提供 using 语句作为建议。

SqlServerTypes 在什么命名空间下?如果那是最上面的Namespace,那为什么安装nuget包后不识别呢?

编辑 - 我在网上找到的解决方案都不适合我。我尝试在我的机器上安装 SQL 2016 CLR Types 以及建议的 nuget 包并将 .cs 转换为 .vb

我确实通过安装我找到的这个 Nuget 包解决了这个问题 安装包HashFoo.SqlServer.SpatialTypes

【问题讨论】:

标签: .net entity-framework nuget nuget-package visual-studio-2017


【解决方案1】:

Install-Package HashFoo.SqlServer.SpatialTypes 为我修复了它。

【讨论】:

    猜你喜欢
    • 2023-04-07
    • 1970-01-01
    • 2023-03-18
    • 2010-12-10
    • 2015-10-14
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2019-01-01
    相关资源
    最近更新 更多