NHibernate WCF Rest IIS7 Fails with Security Exception

Posted by RyanFetz on Stack Overflow See other posts from Stack Overflow or by RyanFetz
Published on 2010-03-23T20:11:43Z Indexed on 2010/03/23 20:13 UTC
Read the original article Hit count: 650

Filed under:
|
|
|

Here is the error:

System.TypeInitializationException: The type initializer for 'NHibernate.Cfg.Environment' threw an exception. ---> System.Security.SecurityException: Request for ConfigurationPermission failed while attempting to access configuration section 'hibernate-configuration'. To allow all callers to access the data for this section, set section attribute 'requirePermission' equal 'false' in the configuration file where this section is declared. ---> System.Security.SecurityException: Request for the permission of type 'System.Configuration.ConfigurationPermission, System.Configuration, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' failed. at System.Security.CodeAccessSecurityEngine.Check(Object demand, StackCrawlMark& stackMark, Boolean isPermSet) at System.Security.CodeAccessPermission.Demand() at System.Configuration.BaseConfigurationRecord.CheckPermissionAllowed(String configKey, Boolean requirePermission, Boolean isTrustedWithoutAptca)

We have the trust level set to Full. Note also that we also have a web site that runs the SAME Nhibernate code and has NO issues. Only the WCF REst Web Service Application has this error?

Any Thoughts as to WHY this is a problem?

© Stack Overflow or respective owner

Related posts about wcf

Related posts about rest