VC# compile problem

Status
Not open for further replies.

BobLewiston

In Runtime
Messages
182
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.
 
When you have the HelloWorld.cs file open in Visual Studio press Ctrl + F5 and it will compile and run it.
 
You may need to edit your windows Path variable to include the directory where the C# compiler resides. You could also specify the complete path instead of just 'csc'. However, if you're going to compile from the command line, you really should be using the .NET SDK command prompt, not the regular command prompt.

From a practical point of view, you should be using Visual Studio. If you're serious about pursuing a career in Windows programming, you'll need a thorough understanding of Visual Studio, as it will be your primary development and debugging tool. I would recommend you start using it now.
 
Status
Not open for further replies.
Back
Top Bottom