Reputation: 305
I have a C# Windows Service and an ASP.NET 4.0 web application that are, at the moment, independent of each other and hosted in the same network.
The Windows Service reads from a database, and generates a text file each time it is invoked.
My intention is to
a) Call the Windows Service from the ASP.NET application. After reading a bit, it seems this can be easily done using the Service Controller class.
b) To display live progress of the Windows Service at the client side (browser)
My initial thoughts were to have some kind of global variables inside the Service, that can then be accessed by the remote asp.net app, but I'd like to know what is the best way to do this.
Upvotes: 2
Views: 2309
Reputation: 2685
The above answer from Kevin seems to be a good idea. But if you really want to have a different service & page without wcf,
I would choose not to go for tying up an asp .net app with a windows service tightly. Instead, I would this.
Upvotes: 2
Reputation: 5733
Here's an MSDN article on hosting a WCF service within a Windows Service:
How to: Host WCF in a Windows Service Using TCP
http://msdn.microsoft.com/en-us/library/cc949080.aspx
Upvotes: 3