对于我当前的项目,我们使用了一些基于CLR 2的混合模式程序集.
为了在.NET 4目标程序集中使用这些,我知道你必须添加useLegacyV2RuntimeActivationPolicy=true到<startup>app.config中的元素.
据我所知,这会更改激活策略,导致使用CLR支持的最高版本加载这些混合模式程序集.
但是,这样做会有副作用吗?启用非默认激活策略时,我应该注意哪些潜在问题?
我正在更新这篇文章,我想我现在知道如何获得这个配置; 但是,还有更多要知道,因为我仍然有一个问题是一个关键领域.
我使用SQLite进行单元测试,现在可以正常工作,使用下面的配置步骤.当我想要使用比内存中测试数据更多的数据的UI测试运行但没有SQLServer的开销时,我也使用它 - 此配置失败,具有以下内容:
{"Could not create the driver from NHibernate.Driver.SQLite20Driver, NHibernate, Version=2.1.0.4000, Culture=neutral, PublicKeyToken=aa95f207798dfdb4."}
Run Code Online (Sandbox Code Playgroud)
这是有关工作的配置的更新信息:
1)哪个SQLite DLL?有一些不好的链接看起来很有帮助,但是它们中存在构建错误.在只有良好的下载,这个日期是这里Source Forge上.v1.066于今天发布,2010年4月18日.
2)您必须使用GAC吗?不,正如毛里西奥回答的那样.
3)x64版本 - 由Mauricio回答.
4)NHib驱动程序 - SQLite20Driver,由Mauricio回答
5)FNH是一种潜在的冲突 - 不,正如Mauricio所回答的那样
干杯,
Berryl
== ADD'L DEBUG INFO ===
当异常被击中并且我调用了SQLite20Drive程序集时,我得到以下内容,这表明驱动程序应该可用.我很想知道,因为配置代码在不同的程序集中.
- 装配时出错----
?typeof(SQLite20Driver).Assembly
{NHibernate, Version=2.1.0.4000, Culture=neutral, PublicKeyToken=aa95f207798dfdb4}
[System.Reflection.RuntimeAssembly]: {NHibernate, Version=2.1.0.4000, Culture=neutral, PublicKeyToken=aa95f207798dfdb4}
CodeBase: "file:///C:/Users/Lord & Master/Documents/Projects/Smack/trunk/src/ConstructionAdmin.WpfPresentation/bin/Debug/NHibernate.DLL"
EntryPoint: null
EscapedCodeBase: "file:///C:/Users/Lord%20%26%20Master/Documents/Projects/Smack/trunk/src/ConstructionAdmin.WpfPresentation/bin/Debug/NHibernate.DLL"
Evidence: {System.Security.Policy.Evidence}
FullName: "NHibernate, Version=2.1.0.4000, Culture=neutral, PublicKeyToken=aa95f207798dfdb4"
GlobalAssemblyCache: false
HostContext: 0
ImageRuntimeVersion: "v2.0.50727"
IsDynamic: …Run Code Online (Sandbox Code Playgroud)