Share via


Hosting a DCS Service Outside of IIS

You can host a DCS service outside of Internet Information Services (IIS) in a custom service host application. You can implement your service host by using any of the standard .NET Framework application types, including Windows Presentation Foundation (WPF), Windows Forms, or console applications.

You can embed the specific code to start and stop the service in the application, and you can use an application configuration file to enable your service host to control endpoint configuration and bindings. In addition to creating a service host to control your service, you must also register the service endpoint in the DCS Management Services Console to enable DCS to locate the service instances hosted by your application.

DCS enables three scenarios for configuring service endpoints in a custom service host:

  • Configure service endpoints in the application code.
  • Configure service endpoints in the application configuration file.
  • Configure service endpoints in a combination of application code and configuration file settings.

The configuration scenario that you choose depends on your hosting requirements. If you have full control over the hosting system, or if your service requires specific endpoint addresses to function, use the first scenario and embed service endpoints in the application code. If you want to enable custom endpoint configuration for system administrators or provide extensibility to your service host, use the second scenario and configure the entire endpoint address list in the application configuration file. Finally, if you want to permanently specify a base address for a service and enable administrators to configure additional addresses, use the final scenario, where you define certain addresses in the application code but enable the application to retrieve additional addresses from the configuration file and create a composite list of endpoints that the service listens to.

The code in the service host application differs, depending on the type of configuration you choose. The remaining topics in this section explain each of the scenarios for custom hosting, including common requirements; they also explain how to build an application based on each scenario.

Required Assemblies

Your service host application must include any service assemblies generated during service deployment. You must also add the following DCS assemblies:

  • Microsoft.ConnectedIndustry.ProcessExecution.Common
  • Microsoft.ConnectedIndustry.ProcessExecution.Configuration.Services
  • Microsoft.ConnectedIndustry.ServiceModel
  • Microsoft.ConnectedIndustry.ServiceModel.Application

You can find these assemblies in the C:\Program Files\Microsoft CIS\DCS\v1.0\bin folder.

You must also include the .NET Framework System.ServiceModel assembly to enable you to create your service host object.

In This Section

Configuring Service Endpoints by Using Application Code

Configuring Service Endpoints by Using the Application Configuration File

Configuring Service Endpoints by Combining Code and the Configuration File