I installed VC# 2008 Express. Following the lessons at C# School at programmersheaven.com, I tried to compile the sample app HelloWorld from the command prompt via:

csc HelloWorld.cs

but I got back:

'csc' is not recognized as an internal or external command, operable program or batch file.

As far as I know, the VC# install is OK. When I did the install, it said it was also installing .Net 3.5, SQL and a lot of other stuff, so I assume it also installed the actual compiler(s). When I click on the desktop icon, the IDE comes up without any error messages.

I didn't try to compile from the IDE though, because it looked a bit more involved, so I thought I'd follow the lessons in order.

Any idea where I went wrong?

P.S. I'm running under Windows XP Professional, Service Pack 2.

csc is not in your path. Add the directory in which csc lives to your PATH environment variable.

As Johnny Carson used to say: "You are correct, sir."

maybe i'm more of an ide guy than command line, but for the editor, you just need to add a class and click Build - Build Solution and voila!!!!

In the pro version you can have a command window with all the needed paths preinstalled in the PATH variable.
In the express version you can use the "Create your first application" on the startpage. It opens a window wich contains a link to creating a console application as well.
But to be honest I'm more a dickersonka kinda guy! Use the IDE! Use the commandline if you absolutly can't do without it. I have seen enough unix commandlines in my life to know what I'm talking about.

if you don't want to add the location of csc to you path you could always fully qualify the location when you compile, ie: c:\windows\microsoft.net\framework\v2.0.blablabla\csc.exe helloworld.cs, although I don't know why on earth you would wanna type this in every time.

This article has been dead for over six months. Start a new discussion instead.