Muhammad Atif Agha
Muhammad Atif Agha

Reputation: 1545

Want to run my own server instance with special port for an ASP.Net 4 based solution

I have made an application in asp.net which sends and receive sms, it works very similar to desktop application and it will be installed on servers to send sms alerts, but the problem is if server does not have iis, it will not work. I have seen many apps which when installed, have their own server and port, you do not need to install any IIS, when you just double click it starts running on a special port and works well, similarly visual studio also runs its own port in development mod, so what is the best way to make such solution for an asp.net product.

Upvotes: 1

Views: 83

Answers (1)

David
David

Reputation: 73564

If you're talking about how to host a service in an application outside IIS, Windows Communication Foundation (WCF), which allows you to host a service in a Windows Forms executable, Console Application, Windows service, or IIS.

It's too big a subject to explain fully here, but there's a nice starting point here.

This will allow you to create the host, and allow you to hose services similar to web services, but with more options for how to connect. (http, tcp, etc.)

But it's not an ASP.NET host. For that, you will need a web server that can execute ASP.NET, such as IIS. There's no way to get around the need to have a web server, whether it's one of the many already established, or if you write your own. I believe there are extensions for Apache that allow you to do so via Mono, but I've never used them. Writing your own would be, in my opinion, a waste of time and a bad idea.

The simplest solution by far is to specify that IIS instaled with the appropriate framework is a requirement for using your website.

Edit

However, if you REALY want to write a WinForms app and have it host ASP.NET, it looks like this previous question has an answer that would help. You can use the Cassini web server, the same one that Visual Studio uses.

Upvotes: 1

Related Questions