开发者

NHibernate WCF Rest IIS7 Fails with Security Exception

开发者 https://www.devze.com 2022-12-23 18:10 出处:网络
Here is the error: System.TypeInitializationException: The type initializer for \'NHibernate.Cfg.Environment\' threw an exc开发者_开发百科eption.

Here is the error:

    System.TypeInitializationException: The type initializer for 'NHibernate.Cfg.Environment' threw an exc开发者_开发百科eption. 

---> 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?


http://www.dotnetnuke.com/Community/Forums/tabid/795/forumid/107/threadid/344545/scope/posts/Default.aspx

change the Identity of the app pool from "ApplicationPoolIdentity" to "NetworkService" and give "NetworkService" account "modify" permissons on the file system folder.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号