Method to configure the system environment variables for c sharp

  • 2020-05-05 11:46:07
  • OfStack

Before using any of the  .NET   SDK   command-line tools (including the   C#   compiler), you need to configure the development machine to recognize their presence. The easiest way is to use   Start   esb0   All   Programs     Visual   2005   esb2   Visual     Tools   menu options, Start the pre-configured   Visual   Studio   command prompt. This particular console automatically initializes the necessary environment variables without requiring you to do anything. Visual   Studio  .NET   2003   users need to launch their own command prompt.    

Note   if you do not have   Visual   Studio, but have already installed  .NET   Framework   SDK, You can launch a pre-configured command prompt from the   Start   |   All   Programs Microsoft  .NET   Framework SDK   2.0   menu option.  

If you want to use the  .NET   command-line tool from any   command prompt, you need to manually update the   Path   variable on your computer. To do this, right-click the   My   Computer   icon on the desktop and select the   Properties   menu option. From the dialog box that appears, click the   Environment   Variables   button located under the   Advanced   TAB. From the dialog box that appears, add the following directory listing at the end of the current   Path   variable in the   System   variable list box (note that entries must be separated by semicolons) :  

C:\Windows\Microsoft.NET\Framework\v2.0.40607  
C:\Program   Files\Microsoft   Visual   Studio   8\SDK\v2.0\Bin  

Note that the list above   points to the path of my current  .NET   2.0   beta. Your path may vary slightly depending on the installation and version of   Visual   Studio   and/or  .NET   SDK  , so be sure to perform integrity checks.    

Immediately after updating the   Path   variable, close all dialogs and any   Console   window currently open for you to submit Settings. You should now be able to execute   csc.exe   and the other  .NET   tools from any command prompt. To test, enter the following command:  

csc   -?  
ildasm   -?  

If you see a lot of information displayed, you can continue.

Related articles: