在 Azure 上找不到“Microsoft.SqlServer.Types"版本 10 或更高版本 [英] 'Microsoft.SqlServer.Types' version 10 or higher could not be found on Azure

查看:53
本文介绍了在 Azure 上找不到“Microsoft.SqlServer.Types"版本 10 或更高版本的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试在 ASP.NET MVC 4 中创建一个 webapi.webapi 使用了实体框架 5 空间类型,我编写了一个非常简单的代码.

I'm trying to make a webapi in ASP.NET MVC 4. The webapi used Entity Framework 5 Spatial types and i have wrote a very simple code.

  public List<Area> GetAllAreas()
    {
        List<Area> aList = db.Areas.ToList();
        return aList;
    }

区域包含 DbGeometry.

Area contains DbGeometry.

当我在本地运行它时,它可以工作,但是当我将它发布到 azure 时,它​​给了我这个错误:

When i run this local it works, but when i publish it to azure it gives me this error:

空间类型和函数不可用于此提供程序,因为找不到程序集Microsoft.SqlServer.Types"版本 10 或更高版本.

Spatial types and functions are not available for this provider because the assembly 'Microsoft.SqlServer.Types' version 10 or higher could not be found.

有人知道怎么解决吗?:)

Anyone know how to resolve this ? :)

谢谢!

推荐答案

我找到了解决方案!只需安装 nuget 包 Microsoft.SqlServer.Types

I found the solution ! Just install the nuget package Microsoft.SqlServer.Types

PM> 安装包 Microsoft.SqlServer.Types

PM> Install-Package Microsoft.SqlServer.Types

链接了解更多信息

这篇关于在 Azure 上找不到“Microsoft.SqlServer.Types"版本 10 或更高版本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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