How to run IIS Express as a process started via a Windows Service

后端 未结 6 1062
情歌与酒
情歌与酒 2020-12-05 15:41

I am trying to distribute IIS Express with my application. IIS Express will serve external web requests on port 80.

I have no problems running IIS Express as well as

6条回答
  •  醉梦人生
    2020-12-05 16:39

    To run IIS 7.5 as administrator, just change your code slightly to:

    Process process = Process.Start(new ProcessStartInfo()
    {
        FileName = IIS_EXPRESS,
        Arguments = arguments.ToString(),
        RedirectStandardOutput = true,
        UseShellExecute = true,
        CreateNoWindow = true,
        Verb = "runas"
    });
    

    This will also enable you to run your site on port 80.

提交回复
热议问题