I am following this document to be able to run my website inside a medium trust atmosphere. My web application uses OleDb, so I have to provide permission in medium trust. I have done everything that's for the reason that article and it is still no longer working :(

During my web_mediumtrust.config I have added the next security class:

<SecurityClass Title="OleDbPermission" Description="System.Data.OleDb.OleDbPermission, System.Data, Version=2..., Culture=neutral, PublicKeyToken=b77a5c561934e089" />

And also the following permission set:

<PermissionSet class="NamedPermissionSet" version="1" Title="ASP.Internet">

   <IPermission class="OleDbPermission" version="1" Unrestricted="true" />

</PermissionSet>

However I get the best after i use it:

System.Security.SecurityException happened Message="Request the permission of type 'System.Data.OleDb.OleDbPermission, System.Data, Version=2..., Culture=neutral, PublicKeyToken=b77a5c561934e089' unsuccessful." Source="mscorlib"
StackTrace: at System.Security.CodeAccessSecurityEngine.Check(Object demand, StackCrawlMark&lifier stackMark, Boolean isPermSet) at System.Security.PermissionSet.Demand() at System.Data.Common.DbConnectionOptions.DemandPermission() at System.Data.ProviderBase.DbConnectionClosed.OpenConnection(DbConnection blah blah blah....

Can there be something I am missing? Must i do other things?

Best wishes.

there's a configuration folder for x32:

%windir%Microsoft.NETFrameworkCONFIG

and the other for x64:

%windir%Microsoft.NETFramework64CONFIG

Personally i think for example stupid...