By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
457,734 Members | 828 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 457,734 IT Pros & Developers. It's quick & easy.

System.Data.OleDb.OleDbPermission error where assembly has FullTrust

P: 27
I used the .NET Framework 2.0 Configuration utility to create a custom code group which:

Refers to the strong name of an assembly on a network drive
Uses the FullTrust permission set.
The assembly simply attempts to obtain a database connection via an OleDbConnection object. The connection string is:

Provider=Microsoft.Jet.OLEDB.4.0;Data Source='C:\Documents and Settings\IssuesViewer12\Issues3.mdb'

When I run a Windows Forms application using the assembly, I experience the following error:

System.Security.SecurityException: Request for the permission of type 'System.Data.OleDb.OleDbPermission, System.Data, Version=, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed.
at System.Security.CodeAccessSecurityEngine.Check(Obj ect demand, StackCrawlMark& stackMark, Boolean isPermSet)...

I have also tried the 'Increase Assembly Trust' wizard to trust the assembly and all others with the same assembly public key.

When I adjust the Zone security for the Local Intranet Zone, I can overcome the problem. However, I do not want to change this setting when it is only a specific assembly for which I wish to configure security.
Please help me!
Mar 27 '07 #1
Share this Question
Share on Google+
2 Replies

Expert 2.5K+
P: 4,871
How are you loading the assembly on the client? Is it a stand-alone exectable, a control loaded via IE, or something else? Also, do you use any library assemblies? If so, did you create them or are they from a third party?
Mar 29 '07 #2

P: 19
I had a similar problem with a windows applications on a network and i think my solution may be of help.

Create two setup projects, one used to deploy the server application (setup that includes the database file) and another to deploy the client project (setup which does not include database file but only primary output).

Install the server project on the machine intended to serve as application server and client project on all other machines.
Nov 25 '08 #3

Post your reply

Sign in to post your reply or Sign up for a free account.