C# help !

Status
Not open for further replies.

red_devil

Back!
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

C# Be Sharp !
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
 
OP
red_devil

red_devil

Back!
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]

"The Cake is a Lie!!"
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.
 

a_tif

Journeyman
  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
 

a_tif

Journeyman
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
 
Status
Not open for further replies.
Top Bottom