开发者

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."

  1. Why this warning appeared on my code?

  2. How to fix it?

  3. 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?

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜