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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T01:56:35+00:00 2026-06-15T01:56:35+00:00

I am currently working on a project and trying to learn about WCF web

  • 0

I am currently working on a project and trying to learn about WCF web services.

I have a console application which hosts a WCF service. I have added the URL that it should be accessible on in the <baseAddress> section of the App.config file. When I run the console application in debug mode in Visual Studio I get a popup saying your services have been hosted.

If I run my app outside of visual studio and go to the URL I then can’t connect, I’m guessing I need to do some configuration to make it work but can’t find what I need to do.

I have two questions, how do I get the WCF service that’s hosted within the console app to be accessible via http:// using IIS for Windows and making it available using the Mono C# with an Apache web server.

Thanks for any help you can provide.

  • 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-15T01:56:36+00:00Added an answer on June 15, 2026 at 1:56 am

    Hosting in IIS – For Testing

    To host the service in IIS, you need to create a virtual directory. There are two ways of doing this:

    For easy testing:

    • Right-click your WCF Service Project in Visual Studio, select Properties / Web
    • Select “Use Local IIS Web Server” in there.
    • Do not enable “Use IIS Express”.
    • Project URL is the address where you server should be visible on the web, ie. http://yourhost/somepath/
    • Click “Create Virtual Directory” (you may need to run Visual Studio as Administrator for this, but this step is only required once, you don’t need admin privileges for day-to-day use).

    After that, your virtual directory is set up and IIS will direct all requests to http://yourhost/somepath to your WCF Service. Note that this will point to the binaries that were generated by Visual Studio inside your project directory, so a rebuild will automatically things.

    This is the easiest option for development and testing, you don’t even need to have Visual Studio open, but whatever change you make will automatically be reflected to the deployed instance.

    Hosting in IIS – For Production

    For production, you need to create a real virtual directory. To do that:

    • Create a directory where your service should be hosted, for instance `C:\inetpub\yoursite\yourservice\’, this can be any directory on your file system.
    • Copy your web service into this directory (Visual Studio has some way of automating this, though I’ve never used that, so don’t really know how that works).
    • Open “Internet Information Services (IIS) Manager” (needs to run as Administrator)
    • On the left pane, you’ll your configured IIS instances and sites. If you run this for the first time and the left pane is empty (there should be a default site), simply right-click and select “Add Web Site”.
    • Right-click your web site, select “Add Virtual Directory”. Alias is the visible name of the new directory, for instance http://yoursite/alias/ and physical path simply points to the directory where you deployed your service to.

    Self-Hosting

    Your console app is called self hosting. If this doesn’t work outside Visual Studio, then there’s usually something wrong with your app.config. I have a simple example here.

    Hosting with Mono

    For Mono, you have three options:

    1. Self-hosting
    2. Apache with mod-mono for production
    3. Apache with mod-mono using current directory for testing

    Self-hosting means creating a simple console application that’s doing some

    var host = new System.ServiceModel.ServiceHost(typeof(MyService));
    host.Open();
    Console.WriteLine("Service running");
    foreach (var se in host.Description.Endpoints)
        Console.WriteLine(se.Address);
    Console.ReadLine();
    host.Close();
    

    and running that with Mono on the command-line.

    See Cannot access WCF service hosted in Apache with mod-mono for how to setup apache with mod-mono, including some samples.

    You also have two options here: either you copy your service into some directory that’s picked up by Apache – or you can also start mod-mono-server manually and specify an arbitrary directory, for instance the current one for testing.

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

Sidebar

Related Questions

I'm currently working on a little project in which I'm trying to create a
I am currently working on a project about calculations.I have done the main part
I'm currently working on a project in c# where I have a service running
I am currently working on a c# asp.net web project and I am trying
I'm trying to learn WCF and I've created a new WCF Service Library project
I'm currently working on a ASP.Net 3.5 project and trying to implement session timeout
I'm currently working on a project using netbeans 6.9 and grails 1.3. I'm trying
I am currently working on an android project and I am trying to create
Heya, I'm currently trying to get bltoolkit working in my project. I've added the
So I'm working on my first big C# project and am currently trying to

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.