CA2122: Do not indirectly expose methods with link demands. How to fix it in my code
CA2122: Do not indirectly expose methods with link demands.
My cod开发者_如何学Pythone 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?
精彩评论