Nhibernate 向库项目C添加配置#

Nhibernate 向库项目C添加配置#,nhibernate,nunit,library-project,iesi-collections,Nhibernate,Nunit,Library Project,Iesi Collections,我在解决方案中有一个控制台项目和一个类库项目。库项目是我的数据访问层(DAL),我还在DAL中使用NHibernate和NET Persistenc API 由于NHibernate需要Iesi.Collections.dll,因此在加载此程序集(位于我的控制台项目的bin文件夹中)时,它给了我以下错误: An attempt was made to load an assembly from a network location which would have caused the asse

我在解决方案中有一个控制台项目和一个类库项目。库项目是我的数据访问层(DAL),我还在DAL中使用NHibernate和NET Persistenc API

由于NHibernate需要Iesi.Collections.dll,因此在加载此程序集(位于我的控制台项目的bin文件夹中)时,它给了我以下错误:

An attempt was made to load an assembly from a network location which would have caused the assembly to be sandboxed in previous versions of the .NET Framework. This release of the .NET Framework does not enable CAS policy by default, so this load may be dangerous. If this load is not intended to sandbox the assembly, please enable the loadFromRemoteSources switch. See http://go.microsoft.com/fwlink/?LinkId=155569 for more information.
但后来我在app.config文件中添加了以下配置,然后它成功加载了Iesi.Collections.dll

  <runtime>
        <loadFromRemoteSources enabled="true" />
    </runtime>

但我仍然无法加载Iesi.Collections.dll,并得到与以前相同的错误。

该文件确实是从网络加载的,还是您需要绕过另一个恼人的安全仪式:

成功了。我刚从文件中找到了Iesi.Collections.dll的属性,并解除了它的阻止。谢谢
 <runtime>
        <loadFromRemoteSources enabled="true" />
   </runtime>
<?xml version="1.0"?>
<configuration>    
    <startup>
        <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/>
    </startup>
    <appSettings>
        <add key="serviceUrl" value="test value" />
    </appSettings>
    <runtime>
        <loadFromRemoteSources enabled="true" />
    </runtime>
</configuration>
 string strVal = System.Configuration.ConfigurationSettings.AppSettings["serviceUrl"];