Re: Strange problem with FileIOPermission
From: Shell (shelld00d_at_yahoo.com)
Date: 09/01/04
- Next message: Patty O'Dors: "So, "no" then?"
- Previous message: Jediah L.: "Re: How to restrict access to source code?"
- In reply to: Nicole Calinoiu: "Re: Strange problem with FileIOPermission"
- Next in thread: Nicole Calinoiu: "Re: Strange problem with FileIOPermission"
- Reply: Nicole Calinoiu: "Re: Strange problem with FileIOPermission"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]
Date: 31 Aug 2004 21:08:52 -0700
Nicole,
The exception is thrown when I click the button that tries to construct
the class. The weird thing is that it never even gets to the
constructor. From my console output, I can see that the assembly gets
loaded:
'Consumer.exe': Loaded 'e:\fun\security\consumer\bin\debug\class1.dll',
Symbols loaded.
In my button code, all I have is:
MyClass foo = new MyClass();
I put a breakpoint here, which it never hits. The security exception is
thrown *before* it gets here. Here's the full text of the exception:
An unhandled exception of type 'System.Security.SecurityException'
occurred in system.windows.forms.dll
Additional information: Security error.
Unhandled Exception: System.Security.SecurityException: Security error.
at Consumer.Form1.button1_Click(Object sender, EventArgs e)
at System.Windows.Forms.Control.OnClick(EventArgs e)
at System.Windows.Forms.Button.OnClick(EventArgs e)
at System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent)
at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons
button, Int32 clicks)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.ButtonBase.WndProc(Message& m)
at System.Windows.Forms.Button.WndProc(Message& m)
at System.Windows.Forms.ControlNativeWindow.OnMessage(Message& m)
at System.Windows.Forms.ControlNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd,
Int32 msg, IntPtr wparam, IntPtr lparam)
at System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG&
msg)
at
System.Windows.Forms.ComponentManager.System.Windows.Forms.UnsafeNativeMethods+IMsoComponentManager.FPushMessageLoop(Int32
dwComponentID, Int32 reason, Int32 pvLoopData)
at System.Windows.Forms.ThreadContext.RunMessageLoopInner(Int32
reason, ApplicationContext context)
at System.Windows.Forms.ThreadContext.RunMessageLoop(Int32 reason,
ApplicationContext context)
at System.Windows.Forms.Application.Run(Form mainForm)
at Consumer.Form1.Main() in e:\fun\security\consumer\form1.cs:line
84
The granted set of the failing assembly was:
<PermissionSet class="System.Security.PermissionSet"
version="1"
Unrestricted="true">
<IPermission
class="System.Security.Permissions.StrongNameIdentityPermission,
mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=<<
comment: removed >>"
version="1"
PublicKeyBlob="<< comment: removed >>"
Name="Consumer"
AssemblyVersion="1.0.1705.17363"/>
<IPermission
class="System.Security.Permissions.UrlIdentityPermission, mscorlib,
Version=1.0.5000.0, Culture=neutral, PublicKeyToken=<< comment: removed
>>"
version="1"
Url="file://E:/Fun/Security/Consumer/bin/Debug/Consumer.exe"/>
<IPermission
class="System.Security.Permissions.ZoneIdentityPermission, mscorlib,
Version=1.0.5000.0, Culture=neutral, PublicKeyToken=<< comment: removed
>>"
version="1"
Zone="MyComputer"/>
</PermissionSet>
The refused set of the failing assembly was:
<PermissionSet class="System.Security.PermissionSet"
version="1">
<IPermission class="System.Security.Permissions.FileIOPermission,
mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=<<
comment: removed >>"
version="1"
Read="c:\myOtherFolder"
Write="c:\myOtherFolder"
Append="c:\myOtherFolder"
PathDiscovery="c:\myOtherFolder"/>
</PermissionSet>
If I remove the [assembly: ] directive from my forms application,
everything works fine... I don't see why it doesn't work if my forms
app explicitly rejects permission to the folder.
Any ideas?
- Next message: Patty O'Dors: "So, "no" then?"
- Previous message: Jediah L.: "Re: How to restrict access to source code?"
- In reply to: Nicole Calinoiu: "Re: Strange problem with FileIOPermission"
- Next in thread: Nicole Calinoiu: "Re: Strange problem with FileIOPermission"
- Reply: Nicole Calinoiu: "Re: Strange problem with FileIOPermission"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]
Relevant Pages
|