【发布时间】:2014-11-20 19:07:12
【问题描述】:
我正在使用 NHibernate 3.3。我有一个案例,我想插入一个未引用的计算列。
My Domain Entity 可以简化为表单
public class Location
{
public virtual IPoint GeoLocation {get;set;}
}
public class MappingOverride : IAutoMappingOverride<Location>
{
public void Override(AutoMapping<Location> mapping)
{
mapping
.Map(e => e.GeoLocation)
.Column("GeoLocation")
.CustomSqlType("geography")
.CustomType<MsSql2008GeographyType>;
}
}
表格列的类型为“地理”
但它会出错
at System.Reflection.RuntimeAssembly.GetExportedTypes(RuntimeAssembly assembly, ObjectHandleOnStack retTypes)
at System.Reflection.RuntimeAssembly.GetExportedTypes()
at GeoAPI.GeometryServiceProvider.GetLoadableTypes(Assembly assembly)
at GeoAPI.GeometryServiceProvider.ReflectInstance()
at GeoAPI.GeometryServiceProvider.get_Instance()
at NetTopologySuite.Geometries.Geometry.set_SRID(Int32 value)
它说它需要Antrl.Runtime,但是一个非常旧的版本。所有Antrl.Runtime nuget 包都有不同的程序集标识符。
无法加载文件或程序集 'antlr.runtime, Version=2.7.6.2, Culture=neutral, PublicKeyToken=1790ba318ebc5d56' 或其依赖项之一。系统找不到指定的文件。
我在一个单独的项目中工作,我按照代码约定使用 map,它在没有任何参考 Antrl.Runtime 的情况下工作。
需要帮助为自己指明正确的方向...
【问题讨论】:
-
是否可以使用程序集重定向到新版本的 Antrl?更多信息在这里(以 log4net 为例):stackoverflow.com/questions/3158928/…
标签: nhibernate spatial fluent-nhibernate-mapping