BackgroundWorker SecurityException: "Request Failed"

  • Thread starter Thread starter Danny T
  • Start date Start date
D

Danny T

Hi,

I've copied the sample code from the .net2 framework docs for the
BackgroundWorker class, but I'm having problems running it! If I compile
it and launch the exe, all works fine. If I launch it from Visual C#
Express (Beta1) by pressing Ctrl+Shift+B, or if I access it via the
webserver ("no-touch deployment"), I get the following exception.

I understand that "no-touch" (not clickonce, I'm just running the .exe
directly) has security restrictions, such as only being able to consume
web services on the launching domain, and no FS access, but something as
simple as Threading I thought would've been covered! :(

Here's the exception; if I can provide any more info that might help,
just ask. Thanks :)



************** Exception Text **************
System.Security.SecurityException: Request failed.
at
System.ComponentModel.AsyncOperationManager.get_OperationSynchronizationContext()
at System.ComponentModel.BackgroundWorker.RunWorkerAsync(Object
argument)
at System.ComponentModel.BackgroundWorker.RunWorkerAsync()
at WindowsApplication1.Form1.button4_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.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.PermissionSet
The Zone of the assembly that failed was:
Internet
 
Danny said:
Hi,

I've copied the sample code from the .net2 framework docs for the
BackgroundWorker class, but I'm having problems running it! If I compile
it and launch the exe, all works fine. If I launch it from Visual C#
Express (Beta1) by pressing Ctrl+Shift+B, or if I access it via the
webserver ("no-touch deployment"), I get the following exception.

I actually meant Ctrl + F5 for launching from C# Express. The app runs,
but gives the same exception as when launched through IIS :(
 
Back
Top