在代码优先实现中使用Entity Framework6的MVC5站点上会出现此错误。有几个模型使用System.Data.Entity.Spatial.DbGeography,如下面的模型所示。
using System;
using System.ComponentModel.DataAnnotations;
using System.Data.Entity.Spatial;
namespace ProjectName.Models
{
public class PostalCode
{
[Key]
[MaxLength(10)]
public string PostalCodeValue { get; set; }
public int Country { get; set; }
[MaxLength(2)]
public string StateAbbr { get; set; }
public DbGeography Geo { get; set; }
}
}在移动到外部测试环境的生产过程中,我们收到以下错误:
There is no store type corresponding to the conceptual side type 'Geography' of primitive type 'Geography'.

发布于 2016-09-16 05:06:26
这个错误有点误导人。在我们的示例中,连接字符串指向比SQL2012旧的站点的前一个版本的数据库。
发生这种情况的原因是因为目标数据库不能处理此数据类型。如果收到此消息,请验证连接字符串是否指向正确的数据库,以及它是否能够使用错误指定的数据类型。
https://stackoverflow.com/questions/39520364
复制相似问题