【问题标题】:Can I run a new process from a medium-trust ASP.NET application?我可以从中等信任的 ASP.NET 应用程序运行新进程吗?
【发布时间】:2011-04-22 04:04:19
【问题描述】:

我正在构建一个 ASP.NET MVC 站点,我想在其中使用 OpenSTV 进行投票。要通过 OpenSTV 运行结果,我必须运行可执行文件。 中等信任度是否允许 ASP.NET 应用程序?

【问题讨论】:

    标签: asp.net asp.net-mvc iis hosting medium-trust


    【解决方案1】:

    除非您在 FullTrust 运行,否则您无法实例化 System.Diagnostics.Process 对象。

    如果您检查装饰类的属性,您会看到对FullTrust 的需求:

    Process Class (MSDN)

    [PermissionSetAttribute(SecurityAction.InheritanceDemand, Name = "FullTrust")]
    [HostProtectionAttribute(SecurityAction.LinkDemand, 
            SharedState = true, Synchronization = true, 
        ExternalProcessMgmt = true, SelfAffectingProcessMgmt = true)]
    [PermissionSetAttribute(SecurityAction.LinkDemand, Name = "FullTrust")]
    public class Process : Component
    

    【讨论】:

      猜你喜欢
      • 2016-11-12
      • 1970-01-01
      • 1970-01-01
      • 2016-01-08
      • 1970-01-01
      • 2021-10-11
      • 1970-01-01
      • 2016-11-25
      相关资源
      最近更新 更多