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

  • Home
  • SEARCH
  • 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 4047204
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T13:39:40+00:00 2026-05-20T13:39:40+00:00

I created a WCF project by going to Add New Project -> WCF service

  • 0

I created a WCF project by going to Add New Project -> WCF service library and when I run it on the development environment, it opens up the WCF test client. How do I install this service on a server that doesn’t have Visual Studio installed (I’d like to not host it on IIS). Should I write a new windows service?

  • 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-20T13:39:41+00:00Added an answer on May 20, 2026 at 1:39 pm

    Create a Windows Service project.

    Add your WCF Service to this project.

    In the main Windows Service class (defaults to Service1.cs), add a member:

    internal static ServiceHost myServiceHost = null;
    

    Modify OnStart() to start a new ServiceHost with your WCF Service type:

     protected override void OnStart(string[] args)
        {
            if (myServiceHost != null)
            {
                myServiceHost.Close();
            }
    
            myServiceHost = new ServiceHost(typeof(MyService));
            myServiceHost.Open();
        }
    

    Modify OnStop():

    protected override void OnStop()
        {
            if (myServiceHost != null)
            {
                myServiceHost.Close();
                myServiceHost = null;
            }
        }
    

    Add a Setup and Deployment project (Setup Project) to your solution. Set output of that project to be the main output of the Windows Service project. When you build the Setup and Deployment project, you should see a Setup.exe file that you can use to install the service.

    Keep in mind you still need to setup your endpoints and bindings. Look into using nettcpbinding for this setup.

    As a final note, reference: Error 5 : Access Denied when starting windows service if you are experiencing problems when starting the Windows Service after installation.

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

Sidebar

Related Questions

I have created a new WCF service library type project. I have created a
I have created a WCF Service Library in VS2010 and can run the service
I’ve just created a WCF service/client and it all works fine when running on
I have created a simple wcf service which used the WCF Service Library template.
I have created a RIA services class library project and things are not going
I have created a WCF service in my project and I have some classes
This is real simple. I have a wcf service (nothing fancy, just New Project->
I created a wcf service based on ServiceHostFactory, and i'm hosting it in IIS6.
I've created a WCF service and when I browse to the endpoint I get
I've created a .NET WCF service that is intended to always be over HTTPS.

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.