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

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

问题描述

我试图在ASP.NET MVC 4中制作一个webapi。webapi使用了Entity Framework 5的空间类型,我已经写了一个非常简单的代码。

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

区域包含DbGeometry。




当空间类型和功能发生时,不可用于此提供程序,因为无法找到程序集Microsoft.SqlServer.Types10或更高版本。


任何人都知道如何解决这个问题?谢谢!

解决方案

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


PM> Install-Package Microsoft.SqlServer.Types


更多信息的链接


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;
    }

Area contains DbGeometry.

When i run this local it works, but when i publish it to azure it gives me this 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.

Anyone know how to resolve this ? :)

Thanks!

解决方案

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

PM> Install-Package Microsoft.SqlServer.Types

Link for more info

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

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