I have a class in framework that I need to self host WCF service like this:
class ServiceMonitor
{
private static ServiceHost _host;
public static void Monitor()
{
_host = new ServiceHost(typeof(ICacheChangeSubscriber));
_host.AddServiceEndpoint(typeof(ICacheChangeSubscriber), new BasicHttpBinding(), "http://localhost/Service");
_host.Open();
}
}
This class will be used both in ASP.NET application and windows service, my question is does this code working both in ASP.NET scenario and windows service scenario? I guess it will work in windows service, how about ASP.NET? would it have any issues?