Are There Any Server Options for ASP.NET Other Than IIS and Apache? - asp.net

Curious as to if ASP.NET is compatible with any other web servers out there (ie. node.js).

A quick search revealed there are a few other options:
Aprelium
Neokernal
Casssini
Cherokee
IIS is still probably the way to go though for asp.net. I'm not a Node expert but from my understanding Node.JS is not related to asp.net. Scott Hanselman wrote this blog post on how to get Node.JS running on Windows through IIS, I've just skimmed the article but you might find it interesting.

Related

What is the best way to host an ASP.NET MVC6 Application

If I understand correctly part of the motivation of ASP.NET vNext is to reduce overhead. An MVC6 application can be self hosting. My question is what is the best practice way of hosting a ASP.NET vNext application. Is there something similar to the WCF activation services that monitor the health of the service or is there some way of doing this from within the application?
The "best" way to host ASP.NET MVC 6 is to choose the way that best matches your app's needs, of course! But that perhaps isn't so helpful as far as advice goes.
First, you need to consider the requirements of the application, such as:
Does it need to run cross-platform?
Does it need health management?
Does it need to use existing IIS modules?
Does it need to run in the context of another application?
Does it need to use Windows Authentication?
And no doubt many more requirements...
Here's a brief summary of the various hosting options and their pros/cons:
IIS is perhaps the most well-known host. It has been hardened for well over a decade. Many popular modules are available for it, including providing various security features. IIS has built-in support for Windows Authentication, logging, app warmup, health management, remote administration, and lots of other features.
IIS Express shares the same codebase as IIS, but can be run without admin privileges.
Kestrel is a cross-platform web server that is being written as part of ASP.NET 5 and is currently most suited for development work. It's very lightweight, which can be both good (nothing in the way!) and bad (not very many features).
Self-host is where you are master of your own domain. Nearly everything is up to you, including figuring out what should happen if there is an unrecoverable error. Self-hosting is a great option if you need to host a server within your app (e.g. a client app that uses a web server to host UI or services that the app directly uses).
There is certainly no one "best" way to host an ASP.NET MVC 6 app, but there are certainly many solutions catered to a variety of needs.
In my answer to ASP.NET vNext is host agnostic, what does it deeply mean? I covered a few other aspects of host agnosticism.
ASP.NET Core 1.1 Answer
The 1.1 release added GZIP compression and response caching.
Kestrel is still not security tested and should not be used without IIS or NGINX as a reverse proxy. This will change at some point.
Kestrel still does not support HTTP 2.0.
Using IIS or NGINX with MVC 6 is slower than MVC 5. Yes MVC 6 is supposed to be faster but only if you use Kestrel on it's own.
ASP.NET Core 1.0 Answer
IIS or NGINX is by far the best host for an ASP.NET MVC 6 application. Below are a list of features you will not get without IIS or NGINX without lots of extra work. Note that all of these features require a small amount of config in the web.config file.
The Kestrel web server has not been battle hardened and tested for security. It's not supposed to be exposed to the internet...yet.
Kestrel does not support HTTP 2.0.
GZIP compression of HTTP requests for saving bandwidth and better performance. This alone is a big enough reason.
Error handling outside of ASP.NET. What happens when you have a .dll file missing? Well IIS will still show an error page and you can customize the error page too.
Dynamic IP security - During a Denial of Service (DoS) attack, a very simple and small 403.501 or 403.502 Forbidden static error page is displayed.

How to host a .NET website in the server

How do I host a ASP.NET website on a server? I have created a website using Visual Studio 2010 as a frontend and sqlserver 2008 as a backend. What are the steps I should take for hosting the website on a server? Do I have to buy any licenses for .NET or SQLServer? If so, how much will this cost?
I use Arvixe (arvixe.com) for all my web hosting needs. They are great, cheap, and offer .NET support. Their administration panel is absolutely easy to use (creating databases, etc.).
Go to Arvixe.com, sign up with one of their ASP.NET plans. They will email you FTP information on how to upload your file content, as well as information on how to log into your admin panel to create the database you need. If you need any help with this process, they have a 24/7 live chat feature and they can help you immediately.
There are numerous ways to host an ASP.Net site on the internet. You will have to research the various methods turned up by searching to see what is best for you.
You can always host it from your own computer with Microsoft's Internet Information Services. This is a solution if you are doing this as a simple project. You'll have to activate/install IIS by checking it off under "Add/Remove Windows Components".
But to be honest, I would take Carmine's suggestion and start up an Arvixe account. You can pay $8/month and have up to 6 websites at any given time. I use it constantly for demonstrating web projects for my company. The only problem I have with them is, as I mentioned in my comment to Carmine's question, their service is sometimes completely down. Today was a great example, I was doing some local work on my site, but of course many of my files and all of my databases are accessed via Arvixe's servers. They were offline for at least an hour and I had to start working on something else until they were back up.

Detecting Changes in an ASP.NET Web Site

The ASP.NET framework does a very good job of detecting when a file has changed and recompiling that file etc. I would like to be able to hook into that update process. Is this at all possible?
I might want to do this as part of an initiative to try and version web sites developed as Web Site projects, versus Web Applications, where the version is easily found in statically deployed assemblies. If I my be misdirecting my energies as there are already better way if versioning web sites, I'd still appreciate some pointers.
I don't know if you can hook into that logic at all - perhaps you could add your code to Application_OnStart as this method will fire when ASP.NET recycles the AppPool and restarts the website.
Have you tried Web Deployment projects?
Scott Gu has a blog post.
You can use ASP.NET SignalR to do it, It's real-time web for .NET
Have you tried developing a separate module for ASP.NET that keeps track of last change?
This might put you on the right path (might -- I haven't tried this).
http://www.codersource.net/csharp_iis_metabase.html (dead link)

Standalone ASP.NET development server

I remember seeing a page on codeproject.com where a developer took one or two .dlls from Visual Studio Web Developer 2008 and created a simple win32 form application for hosting a standalone development server.
It was a small applicaton that allowed you to enter the path, port number, and a "GO" button, and it launched the server standalone, without having Visual Studio installed.
I am looking for that solution but can't seem to find it. I am also aware of the Cassini project, the extended version of it, and a webdev.exe (or something like that) solution, but not the dll + form app.
Thanks in advance.
-- Martin
I don't know what happened to the code project article you mentioned. However the framework has the ability to host and run asp.net web applications. Rick Strahl has a nice article on hosting asp.net webpages within a winform app Using the ASP.Net Runtime
There is also an older article on the cassini server on MSDN
It should be simple enough to do what you want with those articles as a starting off point.

Shibboleth and .NET

I've got a requirement that a ASP.NET web app use Shibboleth for the authentication. Has anyone done this before? Are there libraries out there to support the method calls? Or is this a Java only thing?
It's definitely not a Java-only thing, there's an Apache module available for download on the Shibboleth site.
I don't know if there's anything specific for .NET.
We implemented Shibboleth a while back and we originally tried to use the Java solutions - it was a nightmare. The java apps were badly-written, buggy and badly documented. It was hassle after hassle and we eventually decided to use the Apache module on a dedicated server and forward successfully authenticated users onto our Tomcat app.
The Apache module was a breeze to setup, configure and get working.
Don't know if you've already realised but the Shib documentation and website are incredibly hard to navigate - it's a fight to find any useful information. I did go and look for a .NET implementation on there but gave up!
If our Java experiences are anything to go by I would seriously suggest setting up an Apache server with the Shibboleth module installed and saving yourself a world of pain.
This is a good site for testing your Shibboleth install once you have it set up: http://www.testshib.org/testshib-two/index.jsp
If you do find a good .NET solution then I'd be very interested to hear about it. Good luck!
I know this is a really old question, but I thought I might be able to do a bit better expanding for those who are finding the answers from Google.
As recommended above, you really want to configure your web server to load a module. The hard part of shibboleth is the configuration file, but assuming some one else in your organization has utilized shibboleth you can use theirs as a template and its fairly easy.
For .NET based authentication, you'll need to configure Shibboleth in IIS. The default configuration for IIS creates a directory called /secure, and anything put under there will require shibboleth authentication (i.e. it will redirect to the identity provider). You can configure it to cover other directories or even do lazy authentication.
Once you have the authentication piece in place, you can check headers to "read" the information the identity provider is passing to you. IIS handles things a bit differently then Apache, but its still pretty easy. If you just want username you could use HTTP_REMOTEUSER although there could be better options; i.e. Ohio State University recommends using the eduPersonPrincipalName.
As MatthewMartin says Shibboleth is just a SAML server, Windows Identity Foundation supports SAML as explained in this blog post.

Resources