Strange problem when running a compile Hello World test

  • Thread starter Thread starter Giovanni
  • Start date Start date
G

Giovanni

Hello,

I was playing with Visual C# Compiler version 8.00.40607.42.
I made a simple example to test if the compiler was working fine.
here is the code:


using System;
public class Start{

static void Main()
{
Console.WriteLine("Hello");
}

}

It compiles fine. When I run the executable file, it opens another dos prompt.
While it should just print a line in the shell.
I use windows xp professional.

Could you please explain me why it is doing that.

thanks,

Giovanni
 
Giovanni,

Did you indicte that the target was a console app and not a windows
application? When running csc.exe, you should pass the /target:exe option
to the compiler.

Hope this helps.
 
csc /t:winexe .....

Check compiler options using csc /?

Willy.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top