You must Sign In to post a response.
  • Category: ASP.NET

    System.Diagnostics.Process.Start(file.FullName); Not working in iis

    here the command not working "System.Diagnostics.Process.Start(file.FullName)"; Not working in iis but working in local system. Can one give me the idea.

  • #767199
    It will not work because your application is runnign on server and it may not have access to the process you are trying to run as like client context.

    Open Control Panel-> click Administrative Tools and then click Services.
    Double-click IIS Admin Service.
    On the Log On tab, select the Allow Service to Interact with Desktop check box. Remember to run IIS Admin Service as a local system.
    Stop and restart the IIS Admin Service.

    Goto IIS Manager.
    Select your Application Pool.
    Right click--> Advanced Settings.
    Change value of 'Identity' Variable to-> LocalSystem
    Restart IIS.

  • #767203
    Do you want to run that file on client or on server ? ,if you want to run it on client then 'Process.Start' will not help you more, When you run 'Process.Start' using it will run on server only and open file at server not on client.
    If you want to run file on server then you can use it but it needs additional access permission to run it
    user Impersonation in web.config as below

    < identity impersonate="true" userName="domain\user" password="password" />

    use local server administrator and password

    Editor, DotNetSpider MVM
    Microsoft MVP 2014 [ASP.NET/IIS]

Sign In to post your comments