1

I'm responsible for a .NET process running under windows. The process is running as a windows service.

I would like to have the ability to be able to get some info from the service in a web browser. For that matter I would like to write a small ASP.NET web service. The problem is that I want the run the web service within my process. As far as I know, I can't do that since ASP.NET must run from within an IIS.

so...my question is, is it possible to host ASP.NET server within another process?

I know that in the common scenario, I should have the "process code" run as "code behind" the ASP.NET but in my case, the .NET service is already a part of our product so in this case I'd like to have the opposite.

Thanks a lot.

1 Answer 1

2

You don't have to host ASP.NET inside your service. You can use inter-process communications techniques to communicate between your service and a new or existing ASP.NET webapp. Here's an example using named pipes. Or if you're using .NET 3.5 or higher you can use WCF.

If you really want the service to host its own site I don't think embedding ASP.NET is possible but you can use an http component like this one.

Sign up to request clarification or add additional context in comments.

4 Comments

+1. Also if he's using .net 4.0, built in ipc would be more efficient than wcf. msdn.microsoft.com/en-us/library/…
Thanks for replying. I thought of this option but that means that I'll have to run IIS on the server and I'd like to avoid this option.
Ah in that case you may want to just have your service listen on port 80 and serve up content. Added a link to an embedded http server component for .NET
Well, currently, looks like what I'm going to do. I wanted to avoid the dynamic http code but I guess no other option. Thanks a lot.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.