You need a blank line between the header and the result content.
I just tried this and it works just fine under IIS.
I wouldn't recommend this though - it's pretty slow as you're starting up the .NET runtime on every hit! But it works.
I created a small sample to check this out. I got a little carried away with this actually and looked at how to retrieve all the various form and environment content.
I wrote this up in my WebLog here:
http://west-wind.com/weblog/posts/1143.aspx+++ Rick ---
>Hi Rick,
>
>Firstly, Thanks for your reply and your help.
>
>Yes, I am tring to do a CGI style executable. Have you seen any good references to doing a cgi style application in c#?
>
>I have tried doing what you suggested and I am still getting the error "The specified CGI application misbehaved by not returning a complete set of HTTP headers.".
>
>This is what I did.
>
>
>using System;
>
>class VisionEdit
>{
> static void Main()
> {
> Console.Write(
> @"HTTP/1.1 200 OK
> Content-type: text/html
> Hello World
> ");
> }
>}
>
>
>Have I done this incorrectly?
>
>Thanks for your help.
>
>Kind Regards,
>Tarran