Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Security > System.Security.SecurityException: Request for the permission of type 'System.Security.Permissions.FileIOPermission, mscorlib,...

Reply
Thread Tools

System.Security.SecurityException: Request for the permission of type 'System.Security.Permissions.FileIOPermission, mscorlib,...

 
 
Leyla
Guest
Posts: n/a
 
      08-14-2006
Hi All,
I have created a simple windows control that had one button and opens
up FolderBrowserdialog box.
When I a try to uses this control in my asp.net app, it generates the
following error:

"System.Security.SecurityException: Request for the permission of type
'System.Security.Permissions.FileIOPermission, mscorlib,
Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'
failed."

I have tried to change my IIS settingto Windows Authantication and I
have add <identity impersonate="true"/>

Do I need to do anything with the WindowsControl.dll? or what can I do
to get around this problem.
Thanks Leyla




See the end of this message for details on invoking
just-in-time (JIT) debugging instead of this dialog box.

************** Exception Text **************
System.Security.SecurityException: Request for the permission of type
'System.Security.Permissions.FileIOPermission, mscorlib,
Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'
failed.
at System.Security.CodeAccessSecurityEngine.Check(Obj ect demand,
StackCrawlMark& stackMark, Boolean isPermSet)
at System.Security.CodeAccessPermission.Demand()
at System.Windows.Forms.FolderBrowserDialog.get_Selec tedPath()
at ShowDirectoryButton.UserControl1.btnShowDir_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(MouseEventAr gs 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.Control.ControlNativeWindow.O nMessage(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.W ndProc(Message&
m)
at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32
msg, IntPtr wparam, IntPtr lparam)
The action that failed was:
Demand
The type of the first permission that failed was:
System.Security.Permissions.FileIOPermission
The Zone of the assembly that failed was:
Intranet


************** Loaded Assemblies **************
mscorlib
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.42 (RTM.050727-4200)
CodeBase:
file:///C:/WINDOWS/Microsoft.NET/Framework/v2.0.50727/mscorlib.dll
----------------------------------------
System
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.42 (RTM.050727-4200)
CodeBase:
file:///C:/WINDOWS/assembly/GAC_MSIL/System/2.0.0.0__b77a5c561934e089/System.dll
----------------------------------------
ShowDirectoryButton
Assembly Version: 1.0.2414.26587
Win32 Version: n/a
CodeBase: http://localhost:4496/ShowDirectoryButton.DLL
----------------------------------------
System.Windows.Forms
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.42 (RTM.050727-4200)
CodeBase:
file:///C:/WINDOWS/assembly/GAC_MSIL/System.Windows.Forms/2.0.0.0__b77a5c561934e089/System.Windows.Forms.dll
----------------------------------------
System.Drawing
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.42 (RTM.050727-4200)
CodeBase:
file:///C:/WINDOWS/assembly/GAC_MSIL/System.Drawing/2.0.0.0__b03f5f7f11d50a3a/System.Drawing.dll
----------------------------------------
Accessibility
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.42 (RTM.050727-4200)
CodeBase:
file:///C:/WINDOWS/assembly/GAC_MSIL/Accessibility/2.0.0.0__b03f5f7f11d50a3a/Accessibility.dll
----------------------------------------
Microsoft.mshtml
Assembly Version: 7.0.3300.0
Win32 Version: 7.0.3300.0
CodeBase:
file:///C:/WINDOWS/assembly/GAC/Microsoft.mshtml/7.0.3300.0__b03f5f7f11d50a3a/Microsoft.mshtml.dll
----------------------------------------

************** JIT Debugging **************
To enable just-in-time (JIT) debugging, the .config file for this
application or computer (machine.config) must have the
jitDebugging value set in the system.windows.forms section.
The application must also be compiled with debugging
enabled.

For example:

<configuration>
<system.windows.forms jitDebugging="true" />
</configuration>

When JIT debugging is enabled, any unhandled exception
will be sent to the JIT debugger registered on the computer
rather than be handled by this dialog box.

 
Reply With Quote
 
 
 
 
Henning Krause [MVP - Exchange]
Guest
Posts: n/a
 
      08-16-2006
Hello,

seems like your website is running in medium trust.

What I'm wondering about is - where do you expect the windows control to be
displayed?

Best regards,
Henning Krause

"Leyla" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed) ups.com...
> Hi All,
> I have created a simple windows control that had one button and opens
> up FolderBrowserdialog box.
> When I a try to uses this control in my asp.net app, it generates the
> following error:
>
> "System.Security.SecurityException: Request for the permission of type
> 'System.Security.Permissions.FileIOPermission, mscorlib,
> Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'
> failed."
>
> I have tried to change my IIS settingto Windows Authantication and I
> have add <identity impersonate="true"/>
>
> Do I need to do anything with the WindowsControl.dll? or what can I do
> to get around this problem.
> Thanks Leyla
>
>
>
>
> See the end of this message for details on invoking
> just-in-time (JIT) debugging instead of this dialog box.
>
> ************** Exception Text **************
> System.Security.SecurityException: Request for the permission of type
> 'System.Security.Permissions.FileIOPermission, mscorlib,
> Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'
> failed.
> at System.Security.CodeAccessSecurityEngine.Check(Obj ect demand,
> StackCrawlMark& stackMark, Boolean isPermSet)
> at System.Security.CodeAccessPermission.Demand()
> at System.Windows.Forms.FolderBrowserDialog.get_Selec tedPath()
> at ShowDirectoryButton.UserControl1.btnShowDir_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(MouseEventAr gs 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.Control.ControlNativeWindow.O nMessage(Message& m)
> at System.Windows.Forms.Control.ControlNativeWindow.W ndProc(Message&
> m)
> at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32
> msg, IntPtr wparam, IntPtr lparam)
> The action that failed was:
> Demand
> The type of the first permission that failed was:
> System.Security.Permissions.FileIOPermission
> The Zone of the assembly that failed was:
> Intranet
>
>
> ************** Loaded Assemblies **************
> mscorlib
> Assembly Version: 2.0.0.0
> Win32 Version: 2.0.50727.42 (RTM.050727-4200)
> CodeBase:
> file:///C:/WINDOWS/Microsoft.NET/Framework/v2.0.50727/mscorlib.dll
> ----------------------------------------
> System
> Assembly Version: 2.0.0.0
> Win32 Version: 2.0.50727.42 (RTM.050727-4200)
> CodeBase:
> file:///C:/WINDOWS/assembly/GAC_MSIL/System/2.0.0.0__b77a5c561934e089/System.dll
> ----------------------------------------
> ShowDirectoryButton
> Assembly Version: 1.0.2414.26587
> Win32 Version: n/a
> CodeBase: http://localhost:4496/ShowDirectoryButton.DLL
> ----------------------------------------
> System.Windows.Forms
> Assembly Version: 2.0.0.0
> Win32 Version: 2.0.50727.42 (RTM.050727-4200)
> CodeBase:
> file:///C:/WINDOWS/assembly/GAC_MSIL/System.Windows.Forms/2.0.0.0__b77a5c561934e089/System.Windows.Forms.dll
> ----------------------------------------
> System.Drawing
> Assembly Version: 2.0.0.0
> Win32 Version: 2.0.50727.42 (RTM.050727-4200)
> CodeBase:
> file:///C:/WINDOWS/assembly/GAC_MSIL/System.Drawing/2.0.0.0__b03f5f7f11d50a3a/System.Drawing.dll
> ----------------------------------------
> Accessibility
> Assembly Version: 2.0.0.0
> Win32 Version: 2.0.50727.42 (RTM.050727-4200)
> CodeBase:
> file:///C:/WINDOWS/assembly/GAC_MSIL/Accessibility/2.0.0.0__b03f5f7f11d50a3a/Accessibility.dll
> ----------------------------------------
> Microsoft.mshtml
> Assembly Version: 7.0.3300.0
> Win32 Version: 7.0.3300.0
> CodeBase:
> file:///C:/WINDOWS/assembly/GAC/Microsoft.mshtml/7.0.3300.0__b03f5f7f11d50a3a/Microsoft.mshtml.dll
> ----------------------------------------
>
> ************** JIT Debugging **************
> To enable just-in-time (JIT) debugging, the .config file for this
> application or computer (machine.config) must have the
> jitDebugging value set in the system.windows.forms section.
> The application must also be compiled with debugging
> enabled.
>
> For example:
>
> <configuration>
> <system.windows.forms jitDebugging="true" />
> </configuration>
>
> When JIT debugging is enabled, any unhandled exception
> will be sent to the JIT debugger registered on the computer
> rather than be handled by this dialog box.
>


 
Reply With Quote
 
 
 
 
Leyla
Guest
Posts: n/a
 
      08-17-2006
Hi Henning,
I need my users to be able to pick a directory, so I need the Folder
browser to open up when they click the button. similar to browse
dialog box for selectiong files.
I also have changed the trust level in the web.config, and that has not
helped eighter. Do I need to add the trust level to the assambly of
the windows control?
thank
Leyla

Henning Krause [MVP - Exchange] wrote:
> Hello,
>
> seems like your website is running in medium trust.
>
> What I'm wondering about is - where do you expect the windows control to be
> displayed?
>
> Best regards,
> Henning Krause
>
> "Leyla" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed) ups.com...
> > Hi All,
> > I have created a simple windows control that had one button and opens
> > up FolderBrowserdialog box.
> > When I a try to uses this control in my asp.net app, it generates the
> > following error:
> >
> > "System.Security.SecurityException: Request for the permission of type
> > 'System.Security.Permissions.FileIOPermission, mscorlib,
> > Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'
> > failed."
> >
> > I have tried to change my IIS settingto Windows Authantication and I
> > have add <identity impersonate="true"/>
> >
> > Do I need to do anything with the WindowsControl.dll? or what can I do
> > to get around this problem.
> > Thanks Leyla
> >
> >
> >
> >
> > See the end of this message for details on invoking
> > just-in-time (JIT) debugging instead of this dialog box.
> >
> > ************** Exception Text **************
> > System.Security.SecurityException: Request for the permission of type
> > 'System.Security.Permissions.FileIOPermission, mscorlib,
> > Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'
> > failed.
> > at System.Security.CodeAccessSecurityEngine.Check(Obj ect demand,
> > StackCrawlMark& stackMark, Boolean isPermSet)
> > at System.Security.CodeAccessPermission.Demand()
> > at System.Windows.Forms.FolderBrowserDialog.get_Selec tedPath()
> > at ShowDirectoryButton.UserControl1.btnShowDir_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(MouseEventAr gs 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.Control.ControlNativeWindow.O nMessage(Message& m)
> > at System.Windows.Forms.Control.ControlNativeWindow.W ndProc(Message&
> > m)
> > at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32
> > msg, IntPtr wparam, IntPtr lparam)
> > The action that failed was:
> > Demand
> > The type of the first permission that failed was:
> > System.Security.Permissions.FileIOPermission
> > The Zone of the assembly that failed was:
> > Intranet
> >
> >
> > ************** Loaded Assemblies **************
> > mscorlib
> > Assembly Version: 2.0.0.0
> > Win32 Version: 2.0.50727.42 (RTM.050727-4200)
> > CodeBase:
> > file:///C:/WINDOWS/Microsoft.NET/Framework/v2.0.50727/mscorlib.dll
> > ----------------------------------------
> > System
> > Assembly Version: 2.0.0.0
> > Win32 Version: 2.0.50727.42 (RTM.050727-4200)
> > CodeBase:
> > file:///C:/WINDOWS/assembly/GAC_MSIL/System/2.0.0.0__b77a5c561934e089/System.dll
> > ----------------------------------------
> > ShowDirectoryButton
> > Assembly Version: 1.0.2414.26587
> > Win32 Version: n/a
> > CodeBase: http://localhost:4496/ShowDirectoryButton.DLL
> > ----------------------------------------
> > System.Windows.Forms
> > Assembly Version: 2.0.0.0
> > Win32 Version: 2.0.50727.42 (RTM.050727-4200)
> > CodeBase:
> > file:///C:/WINDOWS/assembly/GAC_MSIL/System.Windows.Forms/2.0.0.0__b77a5c561934e089/System.Windows.Forms.dll
> > ----------------------------------------
> > System.Drawing
> > Assembly Version: 2.0.0.0
> > Win32 Version: 2.0.50727.42 (RTM.050727-4200)
> > CodeBase:
> > file:///C:/WINDOWS/assembly/GAC_MSIL/System.Drawing/2.0.0.0__b03f5f7f11d50a3a/System.Drawing.dll
> > ----------------------------------------
> > Accessibility
> > Assembly Version: 2.0.0.0
> > Win32 Version: 2.0.50727.42 (RTM.050727-4200)
> > CodeBase:
> > file:///C:/WINDOWS/assembly/GAC_MSIL/Accessibility/2.0.0.0__b03f5f7f11d50a3a/Accessibility.dll
> > ----------------------------------------
> > Microsoft.mshtml
> > Assembly Version: 7.0.3300.0
> > Win32 Version: 7.0.3300.0
> > CodeBase:
> > file:///C:/WINDOWS/assembly/GAC/Microsoft.mshtml/7.0.3300.0__b03f5f7f11d50a3a/Microsoft.mshtml.dll
> > ----------------------------------------
> >
> > ************** JIT Debugging **************
> > To enable just-in-time (JIT) debugging, the .config file for this
> > application or computer (machine.config) must have the
> > jitDebugging value set in the system.windows.forms section.
> > The application must also be compiled with debugging
> > enabled.
> >
> > For example:
> >
> > <configuration>
> > <system.windows.forms jitDebugging="true" />
> > </configuration>
> >
> > When JIT debugging is enabled, any unhandled exception
> > will be sent to the JIT debugger registered on the computer
> > rather than be handled by this dialog box.
> >


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Error : Request for the permission of type 'System.Security.Permissions.FileIOPermission,mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'failed. dhemittal@gmail.com ASP .Net Security 0 05-10-2008 06:17 AM
Request for the permission of type 'System.Web.AspNetHostingPermission...'failed clintonb ASP .Net 2 03-28-2008 11:53 AM
Caught Exception: System.Configuration.ConfigurationErrorsException: An error occurred loading a configuration file: Request for the permission of type 'System.Security.Permissions.FileIOPermission, mscorlib, Version=2.0.0.0, Culture=neutral, PublicK Mike ASP .Net 5 08-15-2007 08:57 AM
Request for the permission of type 'System.Data.SqlClient.SqlClientPermission [.....]' failed goc@swipnet.se ASP .Net 1 02-01-2007 01:49 AM
SQL 2005 Assembly: System.Security.SecurityException: Request for the permission of type 'System.Net.WebPermission'... failed Siberwulf ASP .Net 0 10-05-2006 11:39 PM



Advertisments