c# - WCF: What is a ServiceHost? -


As I am currently learning to use WCF services, I'm constantly encountering a tutorial on the Internet which Service Host while using a WCF service

What exactly is this ServiceHost ?


In my current project I am using a WCF service and this is a reference from my app and whenever I want to enjoy it with my app, ServiceClient like:

  I want to instantiate new MusicRepo_DBAccess_ServiceClient (new InstanceContext (instanceContext), custom binding, endpoint address);  

And then from that time access my web methods ( OperationContract s) (explicitly open it before taking the method and later open it with the Open and shutdown )

My WCF service is hosted in my IIS and I can access .svc from my app with ServiceClient < / Code>.

Why and where is ServiceHost used?

A service host basically requires you to host WCF service in non-IIS or WAS settings. . A common place for service hosts will be in a console app or a Windows service. See example code for MSDN.


Comments

Popular posts from this blog

python - Overriding the save method in Django ModelForm -

html - CSS autoheight, but fit content to height of div -

qt - How to prevent QAudioInput from automatically boosting the master volume to 100%? -