I'm trying to use the Server class from Cassini to include a basic web server in my own application. I just started playing around with it to get familiar with the way the server works and I setup a simple app that is as follows:
static void Main(string[] args)
{
Server server = new Server(80, "/", @"C:\Projects\");
server.Start();
Console.ReadLine();
server.Stop();
}
It lets me browse through the directories, however if I try to click on a file, a C# source file (*.cs) for example, it gives the following error:
Server Error in '/' Application.
This type of page is not served.
Description: The type of page you have requested is not served because it has been explicitly forbidden. The extension '.cs' may be incorrect.
Please review the URL below and make sure that it is spelled correctly.
I tried searching for that error text in the Cassini libraries, but didn't find anything.
Where is this error coming from? How can I make it serve up any file? I know it's meant to do asp.net and HTML, but I want it to also server up any file like a normal server would.