2

I have a WCF service which is hosted on localhost, and I have a Metro app which consumes the service. Currently, for using the service, I have to separately run the service in a separate instance of Visual Studio, and after that I run the Metro App client.

Is there any way I can set the client app to start running the service as soon as the app starts, and not again and again start the service separately before the app?

Thanks in advance.

Charles
  • 50,943
  • 13
  • 104
  • 142
Parag Goel
  • 123
  • 2
  • 14

2 Answers2

2

You should host the WCF service using full-blown IIS instead of IIS Express within Visual Studio. You can change this via the Web Tab of the project properties. By using IIS instead of IIS Express, the WCF service will always be listening for requests.

SliverNinja - MSFT
  • 31,051
  • 11
  • 110
  • 173
1

AFAIK, Windows 8 does not support (yet) the communication on localhost from a Metro App to a WCF service. The reason it works in VS is because they did allow this for development use. If you want a continuously running service available, use another (virtual) machine to host it separately.

Alternatively, check out this question on SO for more information about this issue.

Community
  • 1
  • 1
RoelF
  • 7,483
  • 5
  • 44
  • 67