As a side note, if anyone is wondering how I test this then please download the modified medium trust file (called policy.config from Rackspace cloud) unzip it and save it to your web root folder.
Next simply add this to your web.config:-
<system.web> <securitypolicy> <trustlevel name="Custom" policyFile="policy.config" /> </securityPolicy> <trust level="Custom" originUrl="" /> </system.web>You now have a local development system running under medium trust. For those that do not run Rackspace cloud I would recommend asking your hosting provider for their medium trust policy file.
This is an update from a previous post when using NHibernate 3.2 (September 2011). The JIRA issue can be found here.
Hello!
ReplyDeleteI'm trying to run NHibernate 3.3.2 on Medium trust but it fails.
Below is my config section:
NHibernate.Dialect.MsSql2005Dialect
NHibernate.Connection.DriverConnectionProvider
MY_CONNECTION_STRING
And my trust settings:
My Security Exception:
[SecurityException: Request for the permission of type 'System.Configuration.ConfigurationPermission, System.Configuration, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' failed.]
System.Security.CodeAccessSecurityEngine.Check(Object demand, StackCrawlMark& stackMark, Boolean isPermSet) +0
System.Security.CodeAccessSecurityEngine.Check(CodeAccessPermission cap, StackCrawlMark& stackMark) +31
System.Security.CodeAccessPermission.Demand() +46
System.Configuration.BaseConfigurationRecord.CheckPermissionAllowed(String configKey, Boolean requirePermission, Boolean isTrustedWithoutAptca) +84
What am I doing wrong?
trust level="Medium"
ReplyDeletei use default proxy factory integrated into 3.3.2