
46
|
Chapter 3: Web Forms
This is the Title of the Book, eMatter Edition
Copyright © 2008 O’Reilly & Associates, Inc. All rights reserved.
For convenience, it’s usually a good idea to set up a DOS batch file (.bat exten-
sion) with the compilation instructions. Then you can double-click the batch file
in Windows Explorer to recompile the code-behind class. Example 3-5 adds the
pause command to allow you to view any warnings or errors returned by the
compiler before the command-line window is closed.
Because the .NET Framework SDK setup program does not register the path to
the command-line compilers, the command in Example 3-5 will work only if
you add the path to the compilers to the
PATH environment variable. Otherwise,
you will need to use the full path to vbc.exe in your batch file. To add the path
to vbc.exe to the PATH environment variable, do the following:
1. Right-click the My Computer icon on the desktop and select Properties from
the menu.
2. Select the Advanced tab and then click the Environment Variables… button.
3. Under System Variables, scroll to the Path variable, select it, then click Edit…
4. Add a semicolon, followed by the path to vbc.exe (typically
%windir%\
Microsoft.NET\Framework\%version%\
, replacing %windir% with the path to
your Windows directory and
%version% with the version number of the
framework install you want to target) and click OK.
5. Click OK on the Environment Variables ...