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
39
votes
2 answers

WCF: What is a ServiceHost?

As I'm currently learning to use WCF Services, I am constantly encountering tutorials on the internet which mention using a ServiceHost when using a WCF Service. What exactly is this ServiceHost ? In my current project I am using a WCF Service…
Andreas Grech
  • 105,982
  • 98
  • 297
  • 360
37
votes
19 answers

Problem with type of service in ServiceHost directive in wcf service

I am developing a simple wcf service for test. When I test this service with my local IIS 7.5, then it works properly. But when I host it in web IIS, I receive this error: The type 'WcfServiceLibrary1.Service1', provided as the Service…
hamed aj
  • 1,960
  • 8
  • 27
  • 38
15
votes
1 answer

WCF Service - runtime not seeing the ServiceContract on Interface

I'm new to WCF and trying to get my first service running. I'm close but stuck on this problem. In my interface definition file, I have this: [ServiceContract(Namespace="http://mysite.com/wcfservices/2009/02")] public interface…
Mike K
  • 1,313
  • 2
  • 18
  • 28
11
votes
4 answers

Can I call a method in a Self-Hosted WCF Service locally?

I have a WCF Service contract which is basically the Publish Subscriber pattern. The WCF Service is hosted inside the Windows Service that I want to publish from. The Clients subscribe to messages and when the Windows Service does something it…
DJIDave
  • 735
  • 5
  • 19
10
votes
1 answer

WCF: How to stop myServiceHost.Close() from disposing of myServiceHost object?

Apparently Close and Dispose are effectively the same. I want to be able to Close and Open my ServiceHost instance without having to reinstantiate it everytime. Any ideas? Thanks.
Sam
  • 2,663
  • 10
  • 41
  • 60
9
votes
2 answers

How to find out the reason of ServiceHost Faulted event

I have got a MyServiceBase class which inherits from ServiceBase. Inside MyService I Have got a ServiceHost for my WCF-service, whic has only one method with IsOneWay=true property. I used this code to initialize it: host = new…
Alekstim
  • 452
  • 1
  • 8
  • 19
8
votes
1 answer

Async WCF self hosted service

My objective is to implement an asynchronous self hosted WCF service which will run all requests in a single thread and make full use of the new C# 5 async features. My server will be a Console app, in which I will setup a…
Arthur Nunes
  • 6,718
  • 7
  • 33
  • 46
7
votes
1 answer

How to specify ServiceHostFactory for self-hosted WCF service with no SVC file

My application runs as a Windows service. It dynamically creates WCF services using the following helper method: public static void StartWebService(string webServiceName, Type serviceContractType, Type serviceImplementationType) { if…
Laurence
  • 980
  • 12
  • 31
7
votes
3 answers

Servicehost throwing an error, even though added to configuration with netsh

ServiceHost.Open() is throwing this error: HTTP could not register URL http://+:8001/. Your process does not have access rights to this namespace (see http://go.microsoft.com/fwlink/?LinkId=70353 for details). So I used netsh to add the url.…
Terry
  • 5,132
  • 4
  • 33
  • 66
7
votes
1 answer

What are the benefits for several servicehosts? Does one ServiceHost support several simultaneous connections on one endpoint?

I'm thinking of self-hosting my WCF service instead of using IIS. A big question for me is whether I need to instantiate multiple servicehosts as IIS does or one wil be enough. Do muptiple servicehosts give any benefit except security reasons dut…
flashnik
  • 1,900
  • 4
  • 19
  • 38
7
votes
1 answer

How do I pass parameters to a ServiceHost

I am doing the following //Define the service host this._smeediPluginServiceHost = new ServiceHost(typeof(SmeediServiceHost), smeediServiceUri); this._smeediPluginServiceHost.AddServiceEndpoint(typeof(ISmeediServiceHost),…
Toby Holland
  • 1,029
  • 2
  • 14
  • 29
6
votes
1 answer

Duplex callback is always anonymous

I've written a WCF duplex service and client. Everything works well until I try to call .Demand() in the client implementation. It appears that the the service invokes the callback method Anonymously. I think I am missing how to correctly…
Peter
6
votes
2 answers

How to use IPC without being a local Admin?

I currently maintain an internal application in .Net. The application uses IPC to maintain one running session at a time; if another session attempt to open (Someone clicks the icon again, some opens up a saved result file), the second session…
Dan
  • 81
  • 7
6
votes
3 answers

WCF threading - non-responsive UI

I'm trying to configure some WCF stuff. Currently, I have a server which allows remote users to download files, and client. In the server, I use a ServiceHost class. I assume it should be running on a separate thread, however, the server UI…
SharpAffair
  • 5,558
  • 13
  • 78
  • 158
6
votes
2 answers

Cannot start wcf service host

I'm trying to create a service host for my WCF application. When I start the app I get an error saying The service cannot be started. This service has no endpoint defined. Please add at least one endpoint for the service in config file and try…
Antarr Byrd
  • 24,863
  • 33
  • 100
  • 188
1
2 3
10 11