【发布时间】:2011-02-28 16:02:58
【问题描述】:
以如下服务方式为例:-
[PrincipalPermission(SecurityAction.Demand, Role="BUILTIN\\Administrator")]
public string GetTest()
{
try
{
return "Hello";
}
catch (Exception ex)
{
throw ex;
}
}
当调用者不在正确的角色中时,我如何从方法中得到错误。在设计时,错误在方法行(即公共字符串 GetTest)上中断并且没有达到捕获。在运行时,它在我的 silverlight 应用程序中报告为未处理的错误(我也有 try.. catch 块)。 似乎没有地方可以捕获错误,因为它永远不会进入 try 块!
【问题讨论】:
标签: wcf authentication principalpermission