Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6079253
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T10:55:33+00:00 2026-05-23T10:55:33+00:00

I am trying to distribute IIS Express with my application. IIS Express will serve

  • 0

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 serving external requests however Microsoft in their infinite wisdom decided to run IIS Express from a console window as well as a system tray item. You can disable the tray item by a command line argument but not the console window.

I want to run IIS Express without the console window being displayed. I also want to run IIS Express from a windows service.

Running the following code from within my application does exactly what I want:

    Directory.SetCurrentDirectory(string.Format("{0}\\IIS Express", iisProgramDirectory));
    process.EnableRaisingEvents = true;
    //process.Exited += new EventHandler(process_Exited);
    process.StartInfo.FileName = "iisexpress.exe";
    process.StartInfo.Arguments = string.Format("\"/config:{0}webservice\\config\\applicationhost.config\"", dataDirectory);
    process.StartInfo.UseShellExecute = false;
    process.StartInfo.RedirectStandardOutput = true;
    process.StartInfo.RedirectStandardError = true;
    process.StartInfo.CreateNoWindow = true;
    process.StartInfo.WindowStyle = ProcessWindowStyle.Hidden;
    //process.StartInfo.UserName = "Administrator";
    //System.Security.SecureString securePwd = new System.Security.SecureString();
    //string password = "**********";
    //char[] pword = password.ToCharArray();
    //for (int i = 0; i < pword.Length; i++)
    //{
    //  securePwd.AppendChar(pword[i]);
    //}
    //process.StartInfo.Password = securePwd;
    process.Start();

Obviously I am running as Administrator. IIS Express apparently needs to run with Administrator privileges to serve external requests as well as listen on port 80.

My windows service runs under the Windows Service account which I believe has full privileges but the IIS Express process just gracefully exits with an error code of 0 when I try to run it from the windows service.

I have tried a number of scenarios (as you can see from the code snippet) but there seems to be no way I can get IIS Express running using my windows service AND hide the darn console window.

Any suggestions will be appreciated.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T10:55:33+00:00Added an answer on May 23, 2026 at 10:55 am

    It can’t be done if you also want to use Port 80.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to use py2exe to distribute a python application I have written.
I'm running a java application that we distribute as a server-side system. I'm trying
I'm running Python 3.1 on Windows and I'm trying to distribute my Pygame script
I'm trying to distribute this app that I wrote in python. The application consists
I'm trying to distribute a small windows application I made in Visual Studio 2010
I am trying to distribute my Enterprise Application using the method described in the
I'm trying to create an application which should help distribute work to employees or
I'm trying to distribute my iPhone application and doing everything like in apple's manuals.
I have a program that I'm trying to distribute with py2app. When I run
I have a VB6 project (using Visual Studio 6) and I'm trying to distribute

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.