System.Security.SecurityException

时间:2010-02-25 16:05:24

标签: c# .net nhibernate

我正在使用VS2008和NHibernate开发一个Web应用程序,但我无法访问我的数据库(MSSQL Server 2005)。 这是我的堆栈跟踪

  

[SecurityException:请求类型'System.Data.SqlClient.SqlClientPermission,System.Data,   Version = 2.0.0.0,Culture = neutral,PublicKeyToken = b77a5c561934e089'   失败。] System.Security.CodeAccessSecurityEngine.Check(对象   需求,StackCrawlMark& stackMark,Boolean isPermSet)+0
  System.Security.PermissionSet.Demand()+76
  System.Data.Common.DbConnectionOptions.DemandPermission()+79
  System.Data.ProviderBase.DbConnectionClosed.OpenConnection(的DbConnection   outerConnection,DbConnectionFactory connectionFactory)+6265031
  System.Data.SqlClient.SqlConnection.Open()+ 258 8   NHibernate.Connection.DriverConnectionProvider.GetConnection()+224
  NHibernate.Tool.hbm2ddl.SuppliedConnectionProviderConnectionHelper.Prepare()   +30 NHibernate.Tool.hbm2ddl.SchemaMetadataUpdater.GetReservedWords(方言)   方言,IConnectionHelper connectionHelper)+78
  NHibernate.Tool.hbm2ddl.SchemaMetadataUpdater.Update(ISessionFactory   sessionFactory)+149
  NHibernate.Impl.SessionFactoryImpl..ctor(配置cfg,IMapping   映射,设置设置,EventListeners侦听器)+803
  NHibernate.Cfg.Configuration.BuildSessionFactory()+ 129   DALC.Contest.save()+ 128

1 个答案:

答案 0 :(得分:0)