locked
System.Net.WebPermission Error

    Question

  • I have a control that i am loading in to IE to access data from another server. When the control runs i get this error:

    System.Security.SecurityException: Request for the permission of type 'System.Net.WebPermission, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed.
       at IECameraViewer.UserControl1.timer1_Tick(Object sender, EventArgs e)
       at System.Windows.Forms.Timer.OnTick(EventArgs e)
       at System.Windows.Forms.Timer.TimerNativeWindow.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.Net.WebPermission
    The Zone of the assembly that failed was:
    Trusted

    The code runs in the control debugger with out any issues but fails when it is run in IE. I have made sure that the site that the page loads from and that the controll requests data from are both in the trusted sites list.

    What could be the issue and what else can I try?
    Monday, December 29, 2008 9:32 PM

Answers

  • This issue was resolved by having the control load from the same server as the resource it was trying to access.
    • Marked as answer by IfDef Friday, January 02, 2009 9:56 PM
    Wednesday, December 31, 2008 8:14 PM