开发者

CA2122: Do not indirectly expose methods with link demands. How to fix it in my code

开发者 https://www.devze.com 2022-12-24 10:17 出处:网络
CA2122: Do not indirectly expose methods with link demands. My cod开发者_如何学Pythone is as follows:

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

精彩评论

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