C# compiler...

I am working through a C# Tutorial and it tells me to type:

csc DrawingObject.cs Shapes.cs ect...

however everytime I type csc it returns in cmd that csc is an invalid internal or external command.

I have download and installed the .Net SDK, for I was under the understanding that this will allow a user to compile code in the command prompt.

How can I get the SDK to compile or is there a free compiler out there that I can use for C#


I would download C# Express by my work is sketchy about SP2 on ppls machines.  This is something I do hope to have come the new fiscal year, however in the meantime what can I do




Answer this question

C# compiler...

  • MSpencer

    Start - > All Programs ->Microsoft .NET Framework SDK v2.0 -> SDK Command Prompt

  • Pranky

    You might also want to double-check the location you installed the SDK to, and make sure that you're mapping the correct path.

    (Mine, for instance, is D:\SDK\dotnet20)



  • TimFells

    Hmm that still didn't work.

    Why do they make this stuff so difficult and not just include a batch file that runs and automatically sets this stuff up.

    Am I to create a new Path variable each time or just edit what was there adding a ; after each path

     

    Maybe reboot   I dunno it just wasn't working.



  • NodeX

    Hi,

    You need to specify environment variables to map to the directory where your SDK is installed. This is an excerpt from MSDN:

     MSDN wrote:

    If you wish to use .NET command line tools from any Command prompt, you will need to manually update your machine's Path variable. To do so, right-click on the My Computer icon on your desktop and select the Properties menu option. From the resulting dialog box, click the Environment Variables button located under the Advanced tab. From that resulting dialog box, add the following directory listings at the end of the current Path variable found in the System variables list box (be aware that each entry must be separated by a semicolon):

    C:\Windows\Microsoft.NET\Framework\v2.0.40607
    C:\Program Files\Microsoft Visual Studio 8\SDK\v2.0\Bin
    
    Note   The listings above point to paths of my current Beta version of .NET 2.0. Your paths may differ based on your installation and version of Visual Studio and/or the .NET SDK, so be sure to do a sanity check.

    Once you have updated your Path variable, close all dialog boxes and any currently opened Console windows to commit the settings. You should now be able to execute csc.exe and other .NET tools from any Command prompt. To test, enter the following commands:

    csc - 
    ildasm - 
    

    If you see lots of information presented, you are good to go.

     

    cheers,

    Paul June A. Domag



  • Sherley Lee

    You don't need to reboot, but you do need to open a new console window after changing the value.

    You just need to edit the existing variable, putting a ; after each path. If that really isn't working, please cut and paste your complete path into a reply - just type "path" at a command prompt and c'n'p the response.

    Jon



  • C# compiler...