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 8760071
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T14:57:22+00:00 2026-06-13T14:57:22+00:00

I have a WCF Console Application with the following app.config file <?xml version=1.0 encoding=utf-8

  • 0

I have a WCF Console Application with the following app.config file

<?xml version="1.0" encoding="utf-8" ?>
<configuration>
  <system.serviceModel>
    <behaviors>
      <serviceBehaviors>
        <behavior name="serviceBehavior">
          <serviceDebug includeExceptionDetailInFaults="true" />
        </behavior>
      </serviceBehaviors>
    </behaviors>
    <bindings>
      <netNamedPipeBinding>
        <binding name="namedPipeBindingConfig" maxBufferPoolSize="268435456" maxBufferSize="16777216" maxReceivedMessageSize="16777216" />
      </netNamedPipeBinding>
    </bindings>

    <services>
      <service behaviorConfiguration="serviceBehavior" name="MyTestNamespace.MyTestClassService">
        <endpoint address="net.pipe://localhost/MyService"
          binding="netNamedPipeBinding" bindingConfiguration="namedPipeBindingConfig"
          name="NamedPipeBinding" contract="MyTestNamespace.IMyTestContract" />
      </service>
    </services>
  </system.serviceModel>
</configuration>

I am hosting it as a console app (interface, implementation and hosting class all in a single project), basically doing this:

ServiceHost host = new ServiceHost(typeof(MyTestClassService));
host.Open();

I run from command prompt “C:\SomePath\>RunMyService.exe” and it starts and works great. Now, I am planning to host this in IIS 7 and I did not find any good examples on how to get this (console application specifically) deployed there. Few questions I have are:

1) Do I need to “Add website” or “Add Application” in IIS and put my files there ?

2) Will I be needing a .svc file ? If yes, what must it contain and how do I tell it to start this
console app.

3) Will this console app run inside IIS ? How does this work ?

  • 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-06-13T14:57:23+00:00Added an answer on June 13, 2026 at 2:57 pm

    Yes, you’ll need to define a website in IIS in order to host your service in IIS. Also, you won’t actually be running your console application in this configuration. In other words, the Program.Main function will never be called. Instead, IIS will load your MyTestClassService directly using its own ServiceHost implementation.

    Although it is probably possible to use your console app binary with IIS (I say probably because I’ve never actually done this, but it should technically be possible), it might make more sense for you to move your service implementation code into a separate class library project. You can then reference the class library project from your ServiceHost console app and from IIS. This will be less confusing to other developers. In any case you must place the binary that contains your service interface and service definition into the bin directory of the website on which you will be hosting the service.

    The configuration that currently resides in your app.config file will have to be moved to the web.config file of your website, and you’ll have to use a different binding, since IIS doesn’t support net.pipe.

    You don’t have to use an .svc file; you can use configuration based activation if you prefer. This would allow you to set up an empty website with only a web.config file that will host your service.

    The main point is that you won’t be hosting a console app, you’ll be hosting a service. Right now your console app acts as a service host; when you reconfigure IIS will take that role. In order to find more resources, simply look for information about hosting WCF on IIS; the fact that you’re currently hosting with ServiceHost in a console app is irrelevant.

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

Sidebar

Related Questions

I have the following WCF service host console application: static void Main(string[] args) {
So I have wcf rest service which succesfuly runs from a console app, if
I have a WCF service deployed in a console app with BasicHTTPBinding and SSL
I've having a very simple WCF service (a console application for file upload). I
The arhitecture: console application that contains a wcf duplex service; windows app consumers; every
assume I have a hosted wcf service in a console application like this: public
I have a WCF service (instantiated within a Console application on NetTCP), this service
I have a Console application hosting a WCF service. I would like to be
I have a WCF service console application. When I run it from within Visual
I have a WCF service that is hosted on a c# console application. Is

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.