.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

How to use single windows service to host multiple WCF Services instances (Each instance of WCF is i

Posted By:      Posted Date: September 10, 2010    Points: 0   Category :WCF
How to use single windows service to host multiple WCF Services. I have a mutiple instance of same WCF service in different folder, each instance has unique service name and port. WCFService has reference to Reg-Free COM Reference, i have Native.WCFService.manifest in each folder. Ex: WCFService1 is in "C:\WCFService01\WCFService.dll, Native.OCWCFService.manifest, OCWCFService.dll.config WCFService2 is in "C:\WCFService02\WCFService.dll, Native.OCWCFService.manifest, OCWCFService.dll.config Now i need host above services from single Windows Service. I am trying to create AppDomain for each above WCFService Instance from Windows Service and then host. Its working if i register COM dll in the server using regsvr32, but when i un register COM dll, i am getting unable to load COM component .... This looks like AppDomain is not loading COM DLL and Manifest files. Its looks strange but we need it in this way because we have production and test environment in the same server. Everything works fine if create a seperate Windows Service for each WCFService Instance, but my manager wants single Windows Service :). Any help whould be really appreciated.  ravi kumar reddy

View Complete Post

More Related Resource Links

Suspend / Resume Instances within Workflow Service Host (in Windows Service)

We are hosting WF 4 worklfow instances within a Windows Service that uses the Workflow Service host container.   On the Windows Service OnStart we start the workflow service host (w/ multiple WCF endpoints such as start workflow instance, cancel workflow instance, poll workflow instance status, etc.) and these endpoints create or work on one or more long running workflow instances.     My question is, if a user attempts to stop the Windows Service while workflow instance(s) are running, what is the best way to manage this scenario.   Our inclination is to persist these workflows (using sql persistence) and then on the next start of the Windows Service, resume these workflow instances and allow them to continue to completion.    In OnStart, we have a handle to the Workflow Service host.    How can we iterate through all the active workflow instances in OnStop and then in OnStart, resume these after the workflow service host is opened and running?   Are there are any methods of managing this scenario?    Thanks

Web Service Workflows: Deploy Distributed Business Processes With Windows Workflow And Web Services


Due to the distributed nature of a business process it makes sense for a workflow to be deployed as a distributed application. See how Windows Workflow and Web Services hold the key.

Israel Hilerio

MSDN Magazine October 2006

Windows Services: New Base Classes in .NET Make Writing a Windows Service Easy


Windows services are applications that run outside of any particular user context in Windows NT, Windows 2000, or Windows XP. The creation of services used to require expert coding skills and generally required C or C++. Visual Studio .NET now makes it easy for you to create a Windows service, whether you're writing code in C++, C#, or Visual Basic. You can also write a Windows service in any other language that targets the common language runtime. This article walks you through the creation of a useful Windows service, then demonstrates how to install, test, and debug the service.

Ken Getz

MSDN Magazine December 2001

Multiple services in REST Collection WCF Service?


After I create a "REST Collection WCF Service" project, it contains one service "service.svc". Can I add multiple services to this project? There must be a way to do so. Otherwise, it does not make sense to create one project for each service.


My question is how to add a new service to an existing "REST Collection WCF Service" project?


Thanks a lot.

WCF Needs? How to Communicate Multiple Contract via Single Service?

why it needs.   i have many business objects how could i serve to my web application via single service.   i have nearly 500 different business objects. how could contract implement into client web applicatoin.    

Windows service can't use Reporting Services on SQL Service 2008 R2

Hello. I have a Windows service that run as Local System account. The service uses the Reporting Services ReportService2005.asmx web service. When I have SQL Server 2008 installed, I have no problems and my service is able to browse and create report. After I have installed SQL Server 2008 R2 I get the error "The request failed with HTTP status 401: Unauthorized." when the service tries to use the web service. If I change my service to log on as a user with administrator rights, it is able to use Reposting Services again. What has changes in SQL Server 2008 R2, that doesn't allow the Local System account to use Repoting Services? And is it possible to configure Reporting Services to allow it?   - Per

Use of having multiple Services for single silverlight application

Hi My project have 4 modules, I have decided to use single service with multiple interface (1 interface for 1 module, i.e totally 4 interfaces) and multiple partial class ( 4 partial class). Partial classes use this interface. But I have another thought of using multiple service ( 4 services, i.e for each module one service class (.svc)). Please let me know, which approach is right? 

Rebooting one Instance on a SQL 2008 Server with multiple instances installed

Hello, Hoping someone can answer the following questions ... If I have SQL Server 2008 with multiple Named Instances configured on it, can I reboot one Named Instance without rebooting any of the other Named Instances, or without having to reboot the entire server ? For example, if I have an application that needs to be re-booted and it requires the Database to be re-booted. Regards, JD

host and consume wcf rest service in web project in single solution

I have  create a solution which have multiple class library project and a web application Like Web(UI),BL,DAL etc. I have also add a WCF REST starter kit Collection project in the same Solution.WCF Rest API is working fine if I host it on IIS but i want to consume this in my web project without using IIS. Is this possible? if yes then what will be the URI  for my WCF Rest services? Add service reference is also not working because WSDL is disable in rest.

Installing multiple instances of SQL Server R2 creates permissions issues - first instance won't st

After installing two named instances of SQL Server 2008 R2 DataCenter edition (R2D2 and C3P0) I found the first instance would no longer start.  The errorlog showed the reason to be an invalid path. 2010-09-14 18:15:39.12 Server      Error: 17113, Severity: 16, State: 1. 2010-09-14 18:15:39.12 Server      Error 3(The system cannot find the path specified.) occurred while opening file 'C:\MSSQL\SQLDAT\MSSQL10_50.R2D2\MSSQL\DATA\master.mdf' to obtain configuration information at startup. An invalid startup option might have caused the error. Verify your startup options, and correct or remove them if necessary. Finding the files in the proper location I check the ACLs and found the Local Group created for the second instance on the ACL for the first instance.  That is to say for instance R2D2 I found MSP-JANHONJ7\SQLServerMSSQLUser$MSP-janhonj7$C3P0 instead of the MSP-JANHONJ7\SQLServerMSSQLUser$MSP-janhonj7$R2D2 that was originally there. C:\MSSQL\SQLDAT\MSSQL10_50.R2D2\MSSQL\DATA>icacls master.mdf master.mdf NT AUTHORITY\SYSTEM:(F)            BUILTIN\Administrators:(F)            MSP-JANHONJ7\SQLServerMSSQLUser$MSP-janhonj7$C3P0:(F) It seems that creating the second instance causes this problem.  I have been u

Unable to connect to local host service when a splash screen is show before start the services

Hi all:

I want to show a splash screen before start the local host services, the host can be open without error, however the client (Form1) is not able to connect to the service. Without the splash screen, every thing work fine. Any idea why ?

Here is the code.

Imports System.ServiceModel

<ServiceContract()> _
Public Interface IHelloWorldService
   <OperationContract()> _
   Function SayHello(ByVal name As String) As String
End Interface

Public Class HelloWorldService
   Implements IHelloWorldService

   Public Function SayHello(ByVal name As String) As String Implements IHelloWorldService.SayHello
      Return String.Format("Hello, {0}", name)
   End Function
End Class

Module Module1
   Private host As ServiceHost
   Private frmSplash As Form

   Sub Main()
      AddHandler AppDomain.CurrentDomain.AssemblyLoad, Addres

Config Hosting multiple WCF services in one NT service


Hello there,


I've a question about hosting a service in a selfhosting scenario (not IIS or WAS).


For example, I have one WCFService with a config file (web.config). In this config file a system.serviceModel section exists, but also several appSettings.


Hosting in IIS is very simple. I created a svc file and voila, you can call the service. I do not have to place the configsettings of the WCFService into IIS.


Now I turn to host the WCFService in another host, a Windows NT service (or a win/console app).


Why do I have to place all of the WCFService configuration settings in the app.config of the NT Service? Why not just a reference to the physical path of the WCFService.


In the case of three WCFServices hosted by one NT Service, I have to place three web.config contents into the app.config of the NT Service. (Am I wrong? I hope so.)


tnx for reply!




WCF hosted in a Windows Service, how to make calls to the WCF service from within the service host


I have a Windows service that I converted to a WCF service that I want to host in a Windows Service.  I need to do some specific tasks in the OnStart() and OnStop() just like I did when it was just a Windows service.  My original Windows service OnStart() is where I create the main worker thread.  So how do I make a call into my WCF service from within the hosting service? For example in the hosting service's OnStart() I do a host.Open() then I need to call a method in my WCF service but how?



ServiceHost host =

integation services and multiple instances - no backdoor?


When I try to deploy an SSIS package to the second instance on my server, I get a nasty message to use the default instance because the service does not support multiple instances.

So, ... just because the "service" won't support multiple instances, does that mean what it sounds like it means, that there is NO WAY for us to put a second (test) instance on the same server and have separate packages in the respective msdb's on each instance?

I mean, that seems to be what it's saying, but here we are, all eager to do just that ... so if there was a way to make it work without the service, we might try it.  But maybe dtexec won't even be able to fetch the package from msdb?  I don't want to go so far as to export it manually from the (named instance) msdb to a file just to run it ...

since a cheap workaround is simply to put the dtsx files on a file folder instead of msdb anyway.

(in fact, probably would have been my first choice, if anyone had asked me!)





Single WCF Service with multiple ports


Hi All,

            I have  created a WCF service that receive and  give the update to subscribing clients. Now, we host that service on single server only ( this service is hosted as a window service) , So i want when WCF receive any update from a specific client   and  it will give the update  to  only that  specific  client .  I don't want to create separate service for every client . Can i achieve this in single WCF Config file by mention different Ports for each client?  I am using net tcp approach that is best suited for my environment.  I have used BaseAddressPrefix and also mention the URI directly in the endpoints but it  give update to all clients subscribe on different ports. Any solution?  I only wants  this in that way if possible "specific port for that specific client".

Thanks in advance

Multiple Services Using single SQL Process


I'm looking to deploy the following services;
Sharepoint Foundation 2010
Business Contact Manager 2010
Windows Update Services
Forefront Client Security
Autodesk Data Management Services 2011.

I would like SQL Server installed on one host system.

Is it possible/good practice  to setup each of the above's databases to a single SQL process. Or does each need its own process. Or which services will work with one another?. The concern is memory usage.

Thank you.

How to create a WCF web service using TCP protocol hosted on windows services and compatible with no



I need to create a WCF web service . My service will operate on LAN hence I wish to use TCP protocol for that.

So I need to host that web service on windows service.

But I don't know how to make that web service compatible with other platforms.

I wish my service should be platform independent.

If anybody knows the solution then pls let me knw.

ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend