compiling C# in command prompt help

Status
Not open for further replies.

Lionheartilly

Solid State Member
Messages
18
Just installed and tried to learn C# today w/out any other programming experience.

I was reading through a tutorial in

http://www.csharphelp.com/archives2/archive402.html


and I followed everything it told me to.

However, I have a problem with the compiling with csc.
I type:

csc /nologo /out:hello.exe hello.cs

and i receive an error message indicating that csc command does not exist.
I run winXP. please advise, and thanks!
 
it sounds like csc is not on the run path, so when you type it the system doesn't know where to look... First of all, you need to find out where the compiler lives - run a search for csc from search in the start menu - when this comes up right click on it, select properties and where it says location drag the cursor all the way accross the entry (the bit that starts C:\ until you have the whole file location captured) - then hit ctrl c to copy it into the paste buffer - then go to control panel -> system -> Advanced -> Environmant Variables - in the bottom window double click on the word Path - then scroll all the way to the end of the path add a semi colon and press ctrl v to paste the new location. Now the system should be able to find csc on the run path and when you compile your program it will produce a .exe in the location of the .cs source file that you fed to the compiler.

Hope this helps, probably other ways of doing this aswell.

Duncan
 
It works. thanks a lot. However though, now some of the programs in command prompt doesn't work.

Like notepad is not recognized. Do you know the original path?
 
You should have appended the extra path on the end, after a semi colon, not replaced the original with it. If you have done, then use system restore to put back the original path and then repeat the process. It should have looked something like this.

%SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem

good luck
 
I couldn't even start up system restore and it gave me the error message "framedyn.dll was not found"


I inserted the original address and now I can create notepad in cmd, but everytime i open the "properties" in "my computer" it givemes the framedyn.dll error again.

Looks like I really screw it up this time.

Lion
 
You won't be able to run system restore by clicking the icon, because the run path has been cahnged and therefore the system doesn't know where to find it .. Look in the

C:\WINDOWS\system32\Restore

folder and run the rstrui application. If this works, repeat the process above for appending the run path, but make sure that you cursor to the end of the path that is already there, then put in a semi-colon followed by the path to your csc compiler, as before.

Hope all goes well.

duncan
 
Status
Not open for further replies.
Back
Top Bottom