Product:
VB.Net 2005
OS: Windows XP, Windows Server 2000
I have written a small program that pulls data from an Access database. The build works fine on my system (WinXP), but fails to work on any shared drive on our network (Win 2000 Server). When I run it, I throw the following exception.
---------------------
System.Security.SecurityException: Request for the permission of type 'System.Data.OleDb.OleDbPermission, System.Data, Version=2.0.0.0, Culture=meutral, PublicKeyToken=b77a5c561934e089 failed.
at System.Security.CodeAccessSecurityEngine.Check(Obj ect demand, StackCrawlMark&stackMark, Boolean isPermSet)
at System.Security.PermissionSet.Demand()
at System.Data.Commom.DbConnectionOptions.DemandPermi ssion()
at System.Data.OleDb.OleDbConnection.PermissionDemand ()
at System.Data.OleDb.OleDbConnectionFactory.Permissio nDemand(DbConnection outerConnection)
at System.Data.ProviderBase.DbConnectionClosed.OpenCo nnection(DbConnection outerConnection, DbConnectionFactory connectionFactory)
at System.Data.OleDb.OleDbConnection.Open()
The action that failed was:
Demand
The type of the first permission that failed was:
System.Data.OleDb.OleDbPermission
The Zone f the assembly that failed was:
Intranet
-------------------------------
These are the steps I have taken to solve the problem:
First, I updated the server box to .net framework 2.0. I discovered that this did not install the .NET Framework 2.0 Configuration tool. From a local machine, I was able to discover that the global permissions were in the enterprisesec.config file in the framework folder. There was no such file on the server, though I was able to confirm that the 2.0 framework was installed (other software not requiring an oledb connection written with
vb.net 2005 worked perfectly). I uninstalled and reinstalled the .net framework 2.0. This did not solve the problem
I read from Microsoft that the Configuration tool is available in the SDK. This was downloaded and installed on the server. Again - no Configuration tool, no enterprisesec.config file. The SDK was uninstalled and reinstalled. This also did not solve the problem.
I am looking for help on the following:
A) Is there something special about Win 2000 Server that handles the .Net Framework differently than XP?
B) Will writing my own enterprisesec.config for the server work? Will anything adverse happen if I do so?
C) Ultimately, I want this program to work on the shared drive. If I'm not able to find a solution to A and B, is it possible to include something in my code or app.config file to force permissions for OleDb on the server?
If this would be better asked in a programming forum, please let me know.
Any help would be greatly appreciated.