RE: Help: Security Exception

From: Niroo (Niroo_at_discussions.microsoft.com)
Date: 07/14/04


Date: Wed, 14 Jul 2004 02:15:02 -0700

A very popular question which is answered ...

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dndotnet/html/faq111700.asp

The default security policy is to treat code loaded from a file share as partially trusted. It is treated as the IntraNet zone and gets the permissions assigned to that zone.

Niroo

"Stren Assaf" wrote:

> I wrote a C# application that uses ODBC connection to MS-Sql server. The executable is located on one computer on the local network and Im accessing it from a nother pc. I succeed to open it but when im making a databse operation Im getting the following message:
> "The application attempted tp perform an operation not allowed by the security policy. The operation required the SecurityException. To grant this application the required premission please contact your system administrator or use the ...."
>
> What do I need to do ????
>
> this is the details of the message:
> ************** Exception Text **************
> System.Security.SecurityException: Security error.
> at ODBCConnect..ctor()
> at McCann.frmUserConnect.btnOK_Click(Object sender, EventArgs e) in C:\Dev\McCann Ericson\frmUserConnect.cs:line 164
> at McCann.frmUserConnect.frmUserConnect_KeyPress(Object sender, KeyPressEventArgs e) in C:\Dev\McCann Ericson\frmUserConnect.cs:line 217
> at System.Windows.Forms.Control.OnKeyPress(KeyPressEventArgs e)
> at System.Windows.Forms.Control.ProcessKeyEventArgs(Message& m)
> at System.Windows.Forms.Form.ProcessKeyPreview(Message& m)
> at System.Windows.Forms.Control.ProcessKeyMessage(Message& m)
> at System.Windows.Forms.Control.WmKeyChar(Message& m)
> at System.Windows.Forms.Control.WndProc(Message& m)
> at System.Windows.Forms.TextBoxBase.WndProc(Message& m)
> at System.Windows.Forms.TextBox.WndProc(Message& m)
> at System.Windows.Forms.ControlNativeWindow.OnMessage(Message& m)
> at System.Windows.Forms.ControlNativeWindow.WndProc(Message& m)
> at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
>
>
> ************** Loaded Assemblies **************
> mscorlib
> Assembly Version: 1.0.3300.0
> Win32 Version: 1.0.3705.288
> CodeBase: file:///c:/windows/microsoft.net/framework/v1.0.3705/mscorlib.dll
> ----------------------------------------
> System
> Assembly Version: 1.0.3300.0
> Win32 Version: 1.0.3705.288
> CodeBase: file:///c:/windows/assembly/gac/system/1.0.3300.0__b77a5c561934e089/system.dll
> ----------------------------------------
> System.Drawing
> Assembly Version: 1.0.3300.0
> Win32 Version: 1.0.3705.288
> CodeBase: file:///c:/windows/assembly/gac/system.drawing/1.0.3300.0__b03f5f7f11d50a3a/system.drawing.dll
> ----------------------------------------
> Mccann
> Assembly Version: 1.0.1641.27118
> Win32 Version: 1.0.1641.27118
> CodeBase: file://nipendo1/C/Dev/McCann%20Ericson/bin/Debug/Mccann.exe
> ----------------------------------------
> System.Windows.Forms
> Assembly Version: 1.0.3300.0
> Win32 Version: 1.0.3705.288
> CodeBase: file:///c:/windows/assembly/gac/system.windows.forms/1.0.3300.0__b77a5c561934e089/system.windows.forms.dll
> ----------------------------------------
> System.Xml
> Assembly Version: 1.0.3300.0
> Win32 Version: 1.0.3705.288
> CodeBase: file:///c:/windows/assembly/gac/system.xml/1.0.3300.0__b77a5c561934e089/system.xml.dll
> ----------------------------------------
> ODBCCOnnect
> Assembly Version: 0.0.1.0
> Win32 Version: 0.0.1.0
> CodeBase: file://nipendo1/C/Dev/McCann%20Ericson/bin/Debug/ODBCCOnnect.DLL
> ----------------------------------------
> System.Data
> Assembly Version: 1.0.3300.0
> Win32 Version: 1.0.3705.288
> CodeBase: file:///c:/windows/assembly/gac/system.data/1.0.3300.0__b77a5c561934e089/system.data.dll
> ----------------------------------------
> Microsoft.Data.Odbc
> Assembly Version: 1.0.3300.0
> Win32 Version: 1.0.4030.0
> CodeBase: file:///c:/windows/assembly/gac/microsoft.data.odbc/1.0.3300.0__b77a5c561934e089/microsoft.data.odbc.dll
> ----------------------------------------
>