1
 Warning    76  CA2122 : Microsoft.Security : 'User.EmployeeId.get()' calls into 'PropertyValueCollection.Value.get()' which has a LinkDemand. By making this call, 'PropertyValueCollection.Value.get()' is indirectly exposed to user code. Review the following call stack that might expose a way to circumvent security protection: 

->'User.EmployeeId.get()'->'User.EmployeeId.get()' C:\ WiproDaas \ WiproDaas \ DirectoryService \ User.cs 105 DirectoryService

 public string EmployeeId
    {
        get { return this["employeeID"].Value as string; }
        set { if (!string.IsNullOrEmpty(value)) this["employeeID"].Value = value; }
    }

こんにちは、get()の近くで警告が発生しています。解決方法を教えてください。

4

1 に答える 1

1

これは信頼の問題です。次の属性を EmployeeId に追加してみてください。

[EnvironmentPermissionAttribute(SecurityAction.LinkDemand, Unrestricted = true)]
于 2013-01-22T15:01:27.067 に答える