.NETters,

Our application is a .NET user control that gets hosted within IE. When the
user connects to the website, the control automatically gets downloaded and
things work as expected.

In order to increase performance, we now added a background thread to do
some processing. The progress has to be reported to the UI thread via
Control.Invoke method. Here is the code snippet:

private void MyBackgroundThread() {
   // Ensure we don't run into any security problem
   new SecurityPermission(PermissionState.Unrestricted).Assert();

   // Update UI with progress...
   this._uiControl.Invoke(updateDelegate, "Fetching data...");

   ....
}

While this code works fine when the control is hosted in a standard
Winforms application, it throws an exception when hosted under IE. The
exception is:

Request for the permission of type
System.Security.Permissions.SecurityPermission, mscorlib, Version 2.0.0.0,
Culture=neutral, PublicKeyToken=blah failed

In my test scenario, the control is downloaded from http://localhost. As
this machine is already in my "Local Intranet" zone, it already has
extended privilges.

Does anyone have any idea or a workaround to take care of this problem?

We cannot ask the end-users to muck with .NET configurations.

Thank you in advance for your help.

Pradeep

===================================
This list is hosted by DevelopMentorĀ®  http://www.develop.com

View archives and manage your subscription(s) at http://discuss.develop.com

Reply via email to