Questions tagged [servicehost]

Implements the hosting object used to host a WCF service in self-hosted scenarios. Used for loading a service, configuring endpoints, applying security settings, and starting listeners to handle incoming requests.

Implements the hosting object used to host a WCF service in self-hosted scenarios. Used for loading a service, configuring endpoints, applying security settings, and starting listeners to handle incoming requests.

161 questions
6
votes
1 answer

WCF: How to get the reference of created instance from ServiceHost (WCF 4.5)

In my server side console program, multiple ServiceHost objects are created and working in PerSession mode, not singleton. Therefore, a new server side object will be created when a new session started. The problem is: How can I know which is the…
scegg
  • 289
  • 2
  • 9
5
votes
3 answers

How to host WCF service and TCP server on same socket?

Tooday I use ServiceHost for self hosting WCF cervices. I want to host near to my WCF services my own TCP programm for direct sockets operations (like lien to some sort of broadcasting TCP stream) I need control over URL namespaces (so I would be…
Rella
  • 65,003
  • 109
  • 363
  • 636
5
votes
1 answer

Custom ServiceHost with DI and InstanceContextMode.Percall

In my Managed Application, I currently have my WCF services running as: SomeService service = new SomeService(container) //IUnityContainer ServiceHost serviceHost = new ServiceHost(service, serviceAddress); Whats the catch ? SomeService defined…
ilansch
  • 4,784
  • 7
  • 47
  • 96
5
votes
2 answers

WCF - Closing a duplex ServiceHost blocks for CloseTimeout duration if closed when client(s) connected

I have a Windows Service that hosts three different duplex WCF channels. Clients can connect to have updates sent to them via their callback contract. Essentially there are three pub-sub channels. This service takes a long time to bounce when…
Drew Noakes
  • 300,895
  • 165
  • 679
  • 742
4
votes
2 answers

Console hosted WCF service does not Trace

I have written a simple service contract (IServiceObject) and then implemented it (ServiceObject). I host it in a ServiceHost object that is contained within a console application. Within one of my OperationContract methods I call…
Schrader
  • 43
  • 1
  • 7
4
votes
1 answer

WCF service: app.config versus attributes or a mixture of both

In a WCF application we have a servicecontract with attributes: namespace We.Work { [ServiceContract(Namespace = "We", Name = "IWork", SessionMode = SessionMode.NotAllowed)] public interface IWork an implementation of the…
Gerard
  • 13,023
  • 14
  • 72
  • 125
4
votes
4 answers

WCF ServiceHost basicHttpBinding 503 error

I'm trying to run a WCF ServiceHost as an NT Service on a Windows 2007 SP1 Server. The ServiceHost is reponsible for hosting a single service endpoint: a basicHttpBinding with the following address: http://localhost:5555/ToBlah When I run this…
Andy White
  • 86,444
  • 48
  • 176
  • 211
4
votes
1 answer

Self hosted WCF ServiceHost/WebServiceHost Concurrency/Peformance Design Options (.NET 3.5)

So I'll be providing a few functions via a self hosted (in a WindowsService) WebServiceHost (not sure how to process HTTP GET/POST with ServiceHost), one of which may be called a large amount of the time. This function will also rely on a connection…
Kyle
  • 1,366
  • 2
  • 16
  • 28
4
votes
3 answers

Is this a correct way to host a WCF service?

For some testing code, I'd like to be able to host a WCF service in only a few lines. I figured I'd write a simple hosting class: public class WcfHost : IDisposable where Implementation : class where Contract :…
mafu
  • 31,798
  • 42
  • 154
  • 247
4
votes
1 answer

Proper way to close/dispose of a ServiceHost Thread in C#?

I am building a very simple server that has to use named pipes in .NET, and will be ran behind a Windows Forms GUI. I have been able to implement a ServiceHost in a 'Server' class (below) and communicate with it using a 'Client' class. The problem I…
Miles Watson
  • 169
  • 1
  • 8
4
votes
1 answer

properly cleanup System.ServiceModel.ServiceHost

I'm a little confused about the best way to clean up a ServiceHost. I became aware of the issue in my code because of the CA1001 warning from the Visual Studio code analyzer suggesting I implement the IDisposable interface for my class. I have read…
denver
  • 2,863
  • 2
  • 31
  • 45
4
votes
2 answers

Can two applications share same WCF NetTcpBinding port if they use different end point addresses?

I have a Client and Server scenario, where a service is installed on the client and another service on the server. I have no issues when these are installed on different machines. However, I would like to also be able to install both the Client…
Elan
  • 6,084
  • 12
  • 64
  • 84
4
votes
3 answers

How does one set up a WCF ServiceHost within a Windows Service that can access stateful information within the Windows Service

I have a written a Windows Service in C#. It is functioning and performing well. I have added a WCF service to the Windows service to enable client applications to connect to the Windows service and obtain stateful information from the Windows…
Elan
  • 6,084
  • 12
  • 64
  • 84
3
votes
1 answer

WCF:: ServiceHost: Oddity...Still alive even if thread is dead?

a new member here. Nice to see such a neat community. After a bit of research, I decided to use WCF in my application to do inter process communication, so I am using the NetNamedPipeBinding binding. The ServiceHost hosting application is not a…
Futurist
  • 97
  • 3
  • 6
3
votes
4 answers

Self host WCF ServiceHost object lifetime

To kick off my WCF service, I use the following: selfHost = new ServiceHost(typeof(MyServiceClass)); selfHost.Open(); At some point this will create an instance of MyServiceClass. Will it create a single instance or an instance per request?
spender
  • 117,338
  • 33
  • 229
  • 351
1
2
3
10 11