Thursday, July 30, 2009

Someone with visual studio 2005 pls?

Hey I have just loaded visual studio 2005. I make a simple program (a hello world program) with no errors and nothing pops up when I try to run it. NOTHING!





I know some people are going to say it's my code so here it is (C#)





using System;


using System.Collections.Generic;


using System.Windows.Forms;





namespace texthello2


{


static class Program


{


/// %26lt;summary%26gt;


/// The main entry point for the application.


/// %26lt;/summary%26gt;


[STAThread]


static void Main(string [] args)


{


Console.WriteLine("hello world");


Console.ReadLine();





}


}


}

Someone with visual studio 2005 pls?
I don't know why you have a using statement pointing to System.Windows.Forms. That is all about UI, but Console apps don't have a UI. The other poster commented out this and it worked for him because he obviously didn't put in a reference to the .dll. When I put in a reference to System.Windows.Forms it works fine. The surprising thing is that you don't seem to have the reference but that it compiles! In any case, get rid of the "using System.Windows.Forms" as the first poster said and you will be fine.
Reply:I had to comment out the "using System.Windows.Forms" line, and then it worked fine for me!

covent garden

No comments:

Post a Comment