CA2122: Do not indirectly expose methods with link demands.
My code is as follows:
public void LoadPage(Uri url)
{
webBrowser1.Url = url; //webBrowser1 is an object of WebBrowser
webBrowser1.Refresh();
}
Fxcop produced the warning "CA2122: Do not indirectly expose methods with link demands."
Why this warning appeared on my code?
How to fix it?
- How can I grant permission to my code to fullfill Code access security (CAS) attribute. i.e I have an attribute on a method like this [EnvironmentPermissionAttribute(SecurityAction.LinkDemand, Unrestricted = false)]
What permission I have give my code and How for above mentioned attribute?
Thanks