I'm using an Access DB for my app. It runs fine locally, but if I upload it to one of the network drives, I run into an error. I'm not sure how to even begin to approach fixing this.
When first running the exe off of the network drive, I get this following warning:
"Microsoft .NET Security Warning - Never enter personal information or passwords into a window unless you can verify and trust the source of the request."
Then, if I open up a form that attempts to open my DB, I get:
"Application attempted to perfrom an operation not allowed by the security policy. To grant this application the required permission, contact your system administrator, or use the Microsoft .NET Framework Configuration tool.
If you click Continue, the application will ignore this error and attempt to continue. If you click Quit, the application will close immediately.
Request for the permission of type
'System.Data.OleDb.OleDbPermission, System.Data, Version=188.8.131.52, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed."
The connection string that I use in my code is:
con.ConnectionString = "PROVIDER=Microsoft.Jet.OLEDB.4.0;Data Source = profees.mdb"
Try my post @ the end of this thread.
Your needing to increase the Trust of Network level code if I'm reading you correctly.
That worked perfectly!! Thank you! Thank you!
Incidentally, do be aware that in doing so you increase the trust for all apps running from a network location.. The ramifications of such a move would be analogous to switching off a firewall because it was causing you difficulty in using one app. Be careful..
There's no way to increase the trust only for my app?
ok guys, I found this way to add trust to the app run in network:
in command line:
caspol.exe -m -ag LocalIntranet_Zone -url
\\<ServerName>\<FolderName>\* FullTrust -n "<Name>" -d
Well, yep.. that fully trusts all apps whose path starts with that.. Its not exactly what you asked, (fully trusting your app only), but its kinda close..
I could write a .NET app that formats your hard disk, drop it in the same folder as your exe and run it..
And how do you run a .net app there? I could do that with any vb6 or whatever app running it in any location... Right?
Any .NET app whose codebase is in that directory or a subdirectory (i.e. that's where the EXE is) is granted FullTrust. To fully trust any assembly, dll, exe etc - just copy it there.
Originally Posted by superbem
VB6 apps dont have the concept of runtime security because they are not managed code running inside a virtual machine - they run anywhere at any time, with full trust. Caspol and the other .NET security apps only create permissions for .NET apps