How can I compile c# program from command line

I tried to compile c# program from command line and I recieved this message "The name specifined is not recognized as an internal or external command, operable program or batch file."


  • I assume you are attempting to run the csc.exe executable from the command prompt - if so, that error means the path you are giving the command prompt is the wrong one. So if for example 'csc.exe' is stored on your C drive you would specify 'c:csc.exe'.
    What usually causes this is you have a space or something in one of the directories in your path and you are not enclosing the path in quotation marks
    So instead of
    C:My Directorycsc.exe

    you should be using
    "C:My Directorycsc.exe"

    oooor if you are just typing in "csc" as stated in the msdn article [link=]here[/link] then your computer is saying that it doesn't know where csc is and you have to either set it up to know where it is, or just specify the path of csc yourself.
  • The right answer
  • The right answer
  • The right answer
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!