[ACCEPTED]-Is it possible to create a standalone, C# web service deployed as an EXE or Windows service?-embeddedwebserver
Yes, it's possible, you may want to have 1 a look at WCF and Self Hosting.
Yes, it is possible (and fairly easy).
Here 3 is a CodeProject article showing how to make a basic HTTP server 2 in C#. This could easily be put in a standalone 1 EXE or service, and used as a web service.
One technology you might want to check out 4 is WCF. WCF can be a bit of a pain to get 3 into but there's a great screencast over 2 at DNRTV by Keith Elder that shows how to 1 get started with WCF in a very simple fashion.
I would highly recommend WCF. It would 3 fit very well into a product like you are 2 describing. There are a good number of 1 books available.
Sure, you can do that. Be sure to change 7 the Output Type of the project to Console 6 Application. Then, in your Main function, add 5 a string[] parameter. Off of some switch 4 that you receive on the command line, you 3 can branch to ServiceBase.Run to run as 2 a Windows Service or branch to some other 1 code to run a console application.
This question is somewhat older but since 14 I needed something similar some time ago 13 it felt like this question is still relevant.
I 12 wrote a small Rest-API with NancyFx and 11 OWIN. OWIN is a standard interface between 10 .Net applications and web servers. With 9 OWIN it is possible to create a self-hosted WEB-API. Nancy 8 on the other hand is
a lightweight, low-ceremony, framework 7 for building HTTP based services on .NET 6 ¹
The combination of those two makes it possible 5 to create a self-hosted C# Web service. I 4 am quite sure that there are many more possibilities 3 to create something like this by now but 2 since I used it like this I thought the 1 Information might be useful to someone.
More Related questions
We use cookies to improve the performance of the site. By staying on our site, you agree to the terms of use of cookies.