Cassini Error: "This page type is not served"

I am trying to use a server class from Cassini to include a core web server in my own application. I just started playing with it to get acquainted with how the server works, and I am setting up a simple application that looks like this:

    static void Main(string[] args)
    {
        Server server = new Server(80, "/", @"C:\Projects\");
        server.Start();
        Console.ReadLine();
        server.Stop();
    }

It allows me to browse directories, however, if I try to click on a file, for example, the C # source file (* .cs), it will give the following error:

Server error in application "/".

This page type is not served.

Description: The type of page you have the request is not served because it was explicitly prohibited. the extension ".cs" may be incorrect.
Browse the URL below and make sure it is spelled correctly.

Cassini, .

? ? , asp.net HTML, , , .

0
2

.cs , ASP.NET.

master web.config c:\windows\microsoft.net\v2.0.50727\CONFIG\web.config:

<httpHandlers>, , :

<add path="*.cs" verb="*" type="System.Web.HttpForbiddenHandler" validate="True"/>

, , , , .

- app :

<configuration>
   <system.web>
      <httpHandlers>
         <remove verb="*" path="*.cs"/>
      </httpHandlers>
   </system.web>
</configuration>

, , -, .

+2

All Articles