我使用的是NHibernate 3.3。我有一個情況,我想插入一個未被引用的計算列。NHibernate空間映射返回Antrl錯誤
我的域實體可以降低到形式
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>;
}
}
表列的類型爲「Geography`
然而,錯誤出作爲
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'或其依賴項之一。該系統找不到指定的文件。
我在一個單獨的項目中工作,我用代碼約定的地圖,它的工作原理沒有任何參考Antrl.Runtime
。
需要幫助指向自己在朝着正確的方向...
是否有可能使用程序集重定向到更新版本的Antrl?更多信息在這裏(使用log4net作爲例子):http://stackoverflow.com/questions/3158928/referencing-2-differents-versions-of-log4net-in-the-same-solution/3163050#3163050 – DanP 2014-10-06 16:24:57