I'm following this document in order to run my website in a medium trust environment. My web app uses OleDb, so I need to give it permission in medium trust. I've done everything that is in that article and it's still not working :(
In my web_mediumtrust.config I've added the following security class:
<SecurityClass Name="OleDbPermission" Description="System.Data.OleDb.OleDbPermission, System.Data, Version=220.127.116.11, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
And the following permission set:
<PermissionSet class="NamedPermissionSet" version="1" Name="ASP.Net"> <IPermission class="OleDbPermission" version="1" Unrestricted="true" /> </PermissionSet>
But I still get an exception when I try to use it:
System.Security.SecurityException occurred Message="Request for the permission of type 'System.Data.OleDb.OleDbPermission, System.Data, Version=18.104.22.168, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed." Source="mscorlib"
StackTrace: at System.Security.CodeAccessSecurityEngine.Check(Object demand, StackCrawlMark& stackMark, Boolean isPermSet) at System.Security.PermissionSet.Demand() at System.Data.Common.DbConnectionOptions.DemandPermission() at System.Data.ProviderBase.DbConnectionClosed.OpenConnection(DbConnection blah blah blah....
Is there something I'm missing? Do I have to do anything else?
there is a configuration folder for x32:
and another for x64:
I feel such as stupid...
The content is written by members of the stackoverflow.com community.
It is licensed under cc-wiki