in Technology by
What is Self Hosting in WCF?

1 Answer

0 votes
by

We have our project (it may be Windows or a web application or something else) and we want to host one WCF service within this solution locally. This type of hosting is called Self-Hosting. To implement self-hosting we need to include System.Service.Model.ServiceHost namespace.

The following are the advantages of self-hosting:

  • Is easy to use: With only a few lines of code you have your service running.
     
  • Is flexible: You can easily control the lifetime of your services through the Open() and Close() methods of ServiceHost<T>.
     
  • Is easy to debug: Debugging WCF services that are hosted in a self-hosted environment provides a familiar way of debugging, without having to attach to separate applications that activate your service.
     
  • Is easy to deploy: In general, deploying simple Windows applications is as easy as xcopy. You don't need any complex deployment scenarios on server farms, and the like, to deploy a simple Windows application that serves as a WCF ServiceHost.
     
  • Supports all bindings and transports: Self-hosting doesn't limit you to out-of-the-box bindings and transports whatsoever. On Windows XP and Windows Server 2003, IIS limits you to HTTP only.

The following are the disadvantages of self-hosting:

  • Limited availability: The service is reachable only when the application is running.
     
  • Limited features: Self-hosted applications have limited support for high availability, easy manageability, robustness, recoverability, versioning, and deployment scenarios. At least, out-of-the-box WCF doesn't provide these, so in a self-hosted scenario you have to implement these features yourself; IIS, for example, comes with several of these features by default.

Related questions

0 votes
    What is Self Hosting in WCF?...
asked Apr 2, 2021 in Education by JackTerrance
0 votes
    What are the possible ways of hosting a WCF service?...
asked Apr 2, 2021 in Education by JackTerrance
0 votes
    What Is The Formula Used To Determine Reliability And Uptime In Web Hosting?...
asked Sep 26, 2021 in Technology by Editorial Staff
0 votes
    Where Is The Dedicated Hosting Service Used?...
asked Sep 26, 2021 in Technology by Editorial Staff
0 votes
    What Is Web Hosting?...
asked Sep 26, 2021 in Technology by Editorial Staff
0 votes
    Azure is Microsoft’s ___________ as a Service Web hosting service. 1. Software 2. Infrastructure 3. Platform 4. All the options mentioned...
asked Sep 23, 2021 in Technology by JackTerrance
+1 vote
    Azure is Microsoft’s ___________ as a Service Web hosting service....
asked Oct 20, 2020 in Technology by JackTerrance
0 votes
    A company is planning on hosting an application on an Azure Virtual Machine. It needs to be ensured that the application ... plan. Would this satisfy the requirement A. Yes B. No...
asked Nov 20, 2022 in Education by JackTerrance
0 votes
    As a preface: I want to do this as a learning exercise. I'm not trying to produce a commercially ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Apr 26, 2022 in Education by JackTerrance
0 votes
    As a preface: I want to do this as a learning exercise. I'm not trying to produce a commercially ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Apr 23, 2022 in Education by JackTerrance
0 votes
    Which of the following web hosting service use Git control system? (a) GitHub (b) Open Hash (c) Git ... questions and answers pdf, Data Science interview questions for beginners...
asked Oct 29, 2021 in Education by JackTerrance
0 votes
    What will be the output of the following Python code? class tester: def __init__(self, id): self.id = str(id) id="224" >>>temp ... >>>print(temp.id) a) 12 b) 224 c) None d) Error...
asked Jan 2, 2023 in Technology by JackTerrance
0 votes
    What will be the output of the following Python code? class tester: def __init__(self, id): self.id = str(id) id="224" >>>temp ... >>>print(temp.id) a) 12 b) 224 c) None d) Error...
asked Jan 2, 2023 in Technology by JackTerrance
0 votes
    What is a self-referential structure?...
asked Jan 17, 2021 in Technology by JackTerrance
0 votes
    What is a Self-Join?...
asked Dec 9, 2020 in Technology by JackTerrance
...