DIGIT-ARC read-only archive · snapshot: July 23, 2026

C# help !

11 posts · originally from https://geek.digit.in/community/threads/c-help.73365/

red_devil
red_devil Original post #1
Nov 16, 2007 at 6:41 PM
i have just begun learning the C# language for .NET and i want you to help me out ...

i want to learn about programming using C# ... can u please tell me how i can do this ?

i dont want to use VC# ..so i've downloaded .NET SDK and installed it in my D drive.. { my XP is in C } . now how do i run the programs ? i typed out a program in notepad and saved it as a ".cs" file .. and then went to command prompt and typed out csc <filename>.cs and it gave me an error saying could not load file ..

so can anyone please tell me in detail how i can execute a c# program ?
Zeeshan Quireshi
Nov 16, 2007 at 11:01 PM
best way is to use the FREE Version of Visual C# n that is Visual C# 2005 Express .

*msdn2.microsoft.com/hi-in/express/aa700756.aspx

IF you still want to run from command line , then check that when youa re in CMD u have switched to the folder in which the <filename>.cs is saved
red_devil
Nov 16, 2007 at 11:09 PM
hey i did that ... the file i created was on my desktop and once i entered into the command prompt , i just hit csc <file.cs> ... but still got the error !

was wondering if there was any environment variable to be set/ edited..

PS: i dont think i would be doing any "actual" programming stuff ... { just some console programs for now... so i think i will stick onto CMD LINE ... }
[xubz]
[xubz] #4
Nov 16, 2007 at 11:18 PM
What error are you getting exactly? something like the line below?

"test1.cs(7,4): error CS0103: The name 'Console' does not exist in the current
context"

If Yes, type 'using System;' on the top of your Program (or type System.Console.<whatever> instead of just Console.<whatever>)

Edit: (If the above doesn't work) Try this.

Goto C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727 (or something similar)

and try csc-ing from there.
red_devil
Nov 16, 2007 at 11:30 PM
@ ^^^

it says " 'csc' is not recognized as an internal or external command .. "
RCuber
RCuber #6
Nov 17, 2007 at 1:07 AM
use visual studio command prompt for all compilations...
red_devil
Nov 17, 2007 at 7:02 PM
@ charan ... how should i do that ?
RCuber
RCuber #8
Nov 17, 2007 at 11:58 PM
^^^ it must be in the programs> Visual studio .NET > tools
a_tif
a_tif #9
Nov 18, 2007 at 12:41 AM
  1. right click My Computer
  2. Advanced -> Environmental variables
  3. in system variables, select path
  4. select edit
  5. at end append a ; (semicolon)
  6. now enter the directory whr u have the executable
red_devil
red_devil #10
Nov 18, 2007 at 11:00 PM
this one worked perfect... thank u a_tif...
a_tif
a_tif #11
Nov 22, 2007 at 6:31 AM
n6300 said:
this one worked perfect... thank u a_tif...

glad to help


same thing works for any other command which is not recognized as an internal or external command