Before using any. net sdk command line tool (including the C # compiler), you need to configure the development computer to identify their existence. The simplest method is to use the Start | All Programs | Visual Studio 2005 | Visual Studio Tools menu option to Start the pre-configured Visual Studio command prompt. This specific console can automatically initialize necessary environment variables without performing any operations. (Visual Studio. NET 2003 users need to start their respective command prompts ).
Note: If you do not have Visual Studio, but have installed the. NET Framework SDK, you can Start the pre-configuration 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 of the computer. In practice, right-click the My Computer icon on the desktop and select the Properties menu option. In the displayed dialog box, click Environment Variables under the Advanced tab. In the displayed dialog box, add the following directory list at the end of the current Path variable in the System Variable list box (note that the 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 above list points to my current. NET 2.0 test version path. Your path may vary slightly depending on the installation and version of Visual Studio and/or. net sdk. Therefore, ensure that you perform integrity check.
After updating the Path variable, close all the dialog boxes and any Console windows that are currently open to submit the settings. You should be able to execute csc.exe and other. NET tools from any command prompt. To perform a test, enter the following command:
Csc -?
Ildasm -?
If you see a large amount of information displayed, you can continue.