RE: Help: Security Exception

From: Shawn Farkas (shawnfa_at_online.microsoft.com)
Date: 07/16/04

  • Next message: Robert Bouillon: "Specifying credentials for access to a network share (UNC)"
    Date: Fri, 16 Jul 2004 01:07:32 GMT
    
    

    You'll need to modify the security policy on the machine the code is running on ... check out my blog entry to see how:
    http://blogs.msdn.com/shawnfa/archive/2003/06/20/57023.aspx

    -Shawn
    http://blogs.msdn.com/shawnfa

    -- 
    This posting is provided "AS IS" with no warranties, and confers no rights.
    Note:  For the benefit of the community-at-large, all responses to this message are best directed to the newsgroup/thread from which they 
    originated.  
    --------------------
    >Thread-Topic: Help: Security Exception
    >thread-index: AcRo0uK8mwZrQX4KRF6fqNNtRPDVQQ==
    >X-WBNR-Posting-Host: 81.218.233.170
    >From: "=?Utf-8?B?U3RyZW4gQXNzYWY=?=" <Stren Assaf@discussions.microsoft.com>
    >Subject: Help: Security Exception
    >Date: Tue, 13 Jul 2004 05:14:02 -0700
    >Lines: 76
    >Message-ID: <15F18218-433A-48AD-9A10-FC2A8D22B5FA@microsoft.com>
    >MIME-Version: 1.0
    >Content-Type: text/plain;
    >	charset="Utf-8"
    >Content-Transfer-Encoding: 7bit
    >X-Newsreader: Microsoft CDO for Windows 2000
    >Content-Class: urn:content-classes:message
    >Importance: normal
    >Priority: normal
    >X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.0
    >Newsgroups: microsoft.public.dotnet.security
    >NNTP-Posting-Host: TK2MSFTNGXA03.phx.gbl 127.0.0.1
    >Path: cpmsftngxa06.phx.gbl!cpmsftngxa10.phx.gbl!TK2MSFTFEED02.phx.gbl!TK2MSFTNGXA01.phx.gbl!TK2MSFTNGXA03.phx.gbl
    >Xref: cpmsftngxa06.phx.gbl microsoft.public.dotnet.security:6842
    >X-Tomcat-NG: microsoft.public.dotnet.security
    >
    >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
    >----------------------------------------
    >
    >
    >
    >
    >
    >
    >
    

  • Next message: Robert Bouillon: "Specifying credentials for access to a network share (UNC)"

    Relevant Pages

    • Re: X-Win32 and SP2
      ... > Win32. ... Then I run netstat and look at the ports in use by ... If the firewall is ... Security Center Notifies Me" link in the left pane. ...
      (microsoft.public.security)
    • Re: Re: Would I buy Delphi 8 ?
      ... If Win32 remained the direct way to talk to the OS, ... security just can't happen. ... Joanna Carter ... TeamBUG support for UK-BUG ...
      (borland.public.delphi.non-technical)
    • Help: Security Exception
      ... "The application attempted tp perform an operation not allowed by the security policy. ... To grant this application the required premission please contact your system administrator or use the ...." ... at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam) ... Win32 Version: 1.0.3705.288 ...
      (microsoft.public.dotnet.security)
    • Help: Security Exception
      ... "The application attempted tp perform an operation not allowed by the security policy. ... To grant this application the required premission please contact your system administrator or use the ...." ... at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam) ... Win32 Version: 1.0.3705.288 ...
      (microsoft.public.dotnet.security)
    • .NET Security
      ... I also tried to do what I though would remove the security from the compiled EXE and I still get the report below. ... at BSMiniRPT.frmMain.frmMain_Load(Object eventSender, EventArgs eventArgs) ... Win32 Version: 2.0.50727.832 ... CodeBase: ...
      (microsoft.public.dotnet.languages.vb)