报告服务 LocalReport 和 WIF
我有一个使用 WIF 进行身份验证的 wcf Web 服务。该网络服务的部分职责是生成报告并通过电子邮件发送。如果我只用数据呈现报告,一切都很好。如果我包含任何报告参数、报告常量,甚至只是 DateTime。现在我会得到以下异常:
An error occurred during local report processing.Failed to load expression host assembly. Details: Request for the permission of type 'System.Security.Permissions.SecurityPermission, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed
我可以在不使用 WIF 的 WCF 服务中运行相同的报告,因此显然有关安全环境的某些内容是令人困惑的。
我真的不知道如何继续解决这个问题。有人可以帮忙吗? 谢谢!
I have a wcf webservice that uses WIF for authentication. Part of the responsibility of this webservice is to generate a report and email it. If I render the report with data only everything is fine. If I include any report parameters, report constants, or even just DateTime.Now I get the following exception:
An error occurred during local report processing.Failed to load expression host assembly. Details: Request for the permission of type 'System.Security.Permissions.SecurityPermission, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed
I can run the same report in a WCF service that does not use WIF, so clearly something about the security environment is fubarred.
I really don't know how to proceed with solving this problem. Can anyone help?
Thanks!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
这有效:
我真的不明白为什么。我确实知道该报告被授予了无法从 WIF 获得的权限,但我不明白这些权限是什么或者为什么需要它们。那么,我的回答是“授人以鱼”,但其他人能否通过解释更深层次的问题来“授人以鱼”呢?
This works:
I don't really understand why. I do understand that the report is being granted permissions it can't get from WIF, but I don't understand which permissions those are or why it needs them. So, my answer "gives a man a fish," but can someone else "teach a man to fish" by explaining the deeper issue?
我在使用带有 Windows 身份验证的 MVC 3/WinForms 混合应用程序时遇到了同样的问题。我花了一些时间尝试确定报告运行所需的最低权限。对我来说,这也有效:
根据您的偏执程度,您可能会因为更锁定的权限集而感到更安全。
遗憾的是,我没有解释为什么这些特定权限是必要的,也不知道在不同情况下是否需要其他权限,但我希望这是有用的。
I was facing the same problem with an MVC 3/WinForms hybrid app with Windows Authentication. I spent some time trying to determine the minimum permissions required for the report to run. For me, this also works:
Depending on how paranoid you are, you might feel safer with a bit more locked down permission set.
Sadly, I have no explanation for why these particular permissions are necessary and don't know if others are needed under different circumstances, but I hope this is useful.