从 Windows 窗体应用程序运行工作流的 SecurityException(部分信任)

发布于 2024-07-25 14:00:00 字数 1126 浏览 1 评论 0原文

我正在尝试利用从 Windows 窗体应用程序调用的顺序工作流控制台应用程序。 当项目运行时,我单击将创建并启动工作流程的按钮,我得到

SecurityException was unhandled 该程序集不允许部分受信任的调用者。 我正在调用我在 .net2.0 目标应用程序中调用的类。 如果我将相同的引用放入 .net3.5 目标 Windows 表单应用程序中,它也会起作用。

我想既然我有 .net 3.5 sp1 我就不应该遇到这个问题 .NET Framework 3.5 SP1 允许从网络共享启动托管代码!

为什么工作流安全性与我所做的任何其他操作不同? 我读过一些文章,建议我添加

“我宁愿修复工作流请求的权限”,我应该在哪里执行此操作?

我已登录工作流程ConsoleApplication,并且刚刚添加

[assembly: System.Security.Permissions.PermissionSet(System.Security.Permissions.SecurityAction.RequestMinimum,Name="FullTrust")]

到控制台应用程序,但现在当我单击按钮创建并启动工作流程时,我收到此错误:

FileLoadException
Could not load file or assembly 'WorkflowConsoleApplication1, Version=1.0.0.0, Culture=neutral, PublicKeyToken=aac23b652e4eab76' or one of its dependencies. Failed to grant minimum permission requests. (Exception from HRESULT: 0x80131417)

I'm trying to make use of a sequential workflow console application being called from a windows forms app. When the project runs and I click on the button that would create and start the workflow I get

I get SecurityException was unhandled
That assembly does not allow partially trusted callers. I'm calling classes that I call in my .net2.0 targeted apps just fine. It also works if I drop the same reference into a .net3.5 targeted windows forms app.

I thought since I have .net 3.5 sp1 I shouldn't have this issue per
.NET Framework 3.5 SP1 Allows managed code to be launched from a network share!

Why is the workflow security different than anything else I do? I've read a few articles that suggest I add

I'd rather fix the permissions requested by the workflow, where would I do that?

I have signing on for the workflowConsoleApplication and I just added

[assembly: System.Security.Permissions.PermissionSet(System.Security.Permissions.SecurityAction.RequestMinimum,Name="FullTrust")]

to the console application instead I now get this error when I click the button to create and start the workflow:

FileLoadException
Could not load file or assembly 'WorkflowConsoleApplication1, Version=1.0.0.0, Culture=neutral, PublicKeyToken=aac23b652e4eab76' or one of its dependencies. Failed to grant minimum permission requests. (Exception from HRESULT: 0x80131417)

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文