I’m refering the book Microsoft Windows Communication Foundation Step By Step. It says that
If you omit the base address
information in the ServiceHost
constructor, like this:ServiceHost productsServiceHost = new
ServiceHost(typeof(ProductsServiceImpl));the WCF runtime will just use the
address information specified in the
application configuration file, and
automatically listen for requests on
all configured endpoints.
But when I try to declare the ServiceHost class using VS 2010, it gives only 2 option for ServiceHost class. Both of which need base url. Is above constructor removed in VS 2010 or am I missing something?
Figured it out. It was missing the baseAddress element.