Which permissions are required to enable process.start via asp.net application?

后端 未结 2 688
忘了有多久
忘了有多久 2021-01-20 17:54

I have an asp.net application which uses process.start to call an executable (Graphviz). All works well in my development environment, but when I move to production I\'m no

相关标签:
2条回答
  • 2021-01-20 18:12

    Locate your pool under which your site is run, and see under which user is running.

    If you can't do that you can run this code to see the user that your pool is running:

    var user = System.Security.Principal.WindowsIdentity.GetCurrent().User;
    var userName = user.Translate(typeof(System.Security.Principal.NTAccount));
    

    And then give permission to that user to be able to run these files.

    reference: How to find out which account my ASP.NET code is running under?

    0 讨论(0)
  • 2021-01-20 18:21

    I am not use process, use shell and it is running successful.

    1. Create a batch file that include your command. Don't save the batch in system folder.

    2. In IIS, open setting dialog of the application pool that your web site running on. Set the ID of process pool as "localsystem".

    3. Use shell("path\batchfile") to execute the batch file.

    0 讨论(0)
提交回复
热议问题