IIS cgi visual basic .net console app, how to make a hit counter-like app

I am having problems making a simple cgi program work. The page waits for 20 seconds, then only displays Output from CGI:

Environment:
XP (SP3), IIS 5.1

Page T1.shtml:
<html><head><title>Test CGI</title></head>
<body>
        <p>Output from cgi: <!--#exec cgi="/cgi-bin/T1.exe" --> </p>
</body></html>

Here is T1.exe, a compiled VS 2005 console app:
    Sub Main()
        Console.WriteLine("Hello, world!")
    End Sub
(I apologize for dumping source, but this one is easier to list than explain)

I think I am close, if I add a mapping configuration entry to map .exe to aspnet_isapi.dll, I do get output that kinda looks like the binary program.

Can anybody see what I am doing wrong?

Also, please tell me if I am going about this all wrong. The purpose of the cgi is to select and insert images into html and simple asp pages (I only use asp to get the include feature). The program will be a complicated visual basic .net app, but the output will either be dumping the selected file or a links to it.

I used to write cgi code on other platforms. Hit counters (remember those things)  were a common cgi app. You pass the page name as a parm and your program processed it (add a counter in a db rec) and optionally returned a string representation of a number. I also have written many aspx apps. I want to insert an image into pages that are maintained by an html editor.

Thank you.
MikeBroderickAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

ahoffmannCommented:
>  Console.WriteLine("Hello, world!")
does this mean that you want to write on STDOUT of the console window?
That most likely does not work in a web application on wndoze systems 'cause the web server has no console window.
You have to write to STDOUT of the program, which is then the response send to the browser.
0
MikeBroderickAuthor Commented:
I opended a case with MS Support. They determined that it is a bug with dotnet 2.0, IE 7, and IIS. They plan on fixing it in IE 8.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Scripting Languages

From novice to tech pro — start learning today.