在.NET中,DbGeography.PointFromText在实现它时会抛出一个未实现的异常吗?

时间:2018-02-12 12:48:40

标签: c# .net entity-framework

所以我试图在旧的Geography项目中尝试一些简单的.NET 4.6.2内容。我已安装EF 5(未计划升级到EF 6)。

当我尝试做一些简单的DbGeography.PointFromText("POINT 1 1", 4326);时,我会抛出Not Implemented Exception

e.g。

SqlServerTypes.Utilities.LoadNativeAssemblies (AppDomain.CurrentDomain.BaseDirectory);
var xxx = System.Data.Spatial.DbGeography.PointFromText("POINT(1 1)", 4326);

enter image description here

我认为EF 5中有这种方法,它可以使用吗? (例如关于使用DbGeograpghy)的参考资料。

我做错了吗?是否有可能错误的(旧的?)dll被使用,因此被抛出?

更新1(可能不重复)。

有人建议问题是因为DbGeography需要(来自nuget)Microsoft.SqlServer.Types包。所以我尝试从nuget安装,然后确保我加载'这些特殊的dll在测试开始时。问题仍然存在。

更新2

使用NuGet Microsoft.SqlServer.Types version 14.0.314.76 (current version as of the time of this post)

0 个答案:

没有答案