ASPCompiler Creation and build
ASP Compiler 1.1 documentation is under development. See also the examples.

ASPC Projects

The ASPC IDE supplies an user interface for creation of so called projects. The project consist of project settings, file list with options for each file, version information (optional), and (optional) Compile Time Scripts attached to some of the files.

Project settings

The settings dialog allows you to configure:

  1. The external objects/namespaces. The list contains the namespaces available for the script. In ASP they will be Request, Server, Response and so on. In WSH (Windows Scripting Host) it will contain only WScript. You can add/delete namespaces and thus define your script context.
    For example you can put here custom namespaces supported by a custom script host (many products support active scripting and you may want to compile your scripts for them). Or you may want to delete unused namespaces - for example if your ASP pages do not use Application object you can delete it from the list ant thus minimize the project size and complexity. Also if you are planning deployment on a non-IIS platform this platform may not support some of the namespaces and you will need to compile without them.
  2. Paths. There are 3 paths in the dialog box. All of them can be specified relative or as full paths. If you enter relative paths they will root in the directory containing the ASPC project file - that's why IDE asks you to save the project as soon as possible. 
    Source site root: ASPC expects all the source files to be found in a single directory tree under the folder specified in this edit box. All the virtual includes will be resolved as like the folder is the WEB site root. You will receive an error in compile time if some of the source files are not under the specified root. This may happen if you moved the project file without the directory tree or if you changed the save location. In such a case you will need to correct the path to point to the actual source root or keep it "as is", but copy the files with the entire tree under the location specified in the edit box.
    Destination site: This is the output directory. ASPC will create it and all the required directories under it if the corresponding sub-directory does not exist. All the non-VB output files will be stored under this directory. ASPC will put them in directories corresponding to the structure found in the source site - i.e. the source site will be recreated but with the output files. Depending on the file processing options output files can be "loader" files, converted files or just copied.
    VB project directory: This directory will contain the VB project files after successful compilation. All the files are stored in the same directory and the VB project can be easily copied or archived.
  3. Project name: Project name is very important. It becomes the first part of the COM classes ID. Thus you should pay attention to select the project name. You can use the same project name for several projects but only if you are sure the resting part of the class IDs will not be repeated. See Program IDs and ClassName directive for details.
  4. Compile-Time scripting (CTS): CTS is defined per each file but if most of the files in the project will use the same script it can be configured in the project settings and then treated as "default" CTS script. See Compile Time Scripting chapters for more information on CTS.
  5. Compiler variables: Set of named custom textual variables that can be inspected by the Compile Time scripts. These variables allow the developer to pass information to the compiler extensions. This information is used by the CTS to determine certain settings or adjust their behaviour. For example you may have script that places the company name in the file - then it may inspect certain compiler variable and get the name from it or, another example, a CTS may need to "know" if it must perform certain operation or not - then a compiler variable may change its behaviour as needed. The compiler variables specified in the project settings are global for the entire project, another set of variables can be specified for each file.
  6. Misc. settings. The project settings also include:
    - Save full paths option
    - Debug build
    - Compile-Time script global directory.
    - Translate ASP tags in option.

File list

File list is displayed in the "Files" window. You can add/remove files from it and set their processing options. You can do so using the toolbar, menu and the context menu (right mouse click).

Files listed in this window are the files that will be passed to the compiler for processing. The columns in the table specify details about every file - file name,  processing type, path and description for the processing option selected. Clicking a column header will sort the files.

Processing options: ASPC selects automatically how to process a file depending on its file name extension. For some files the extension is not enough informative and you may need to change the processing options by opening the file options dialog box. To do so - select a file and choose file options from edit menu or right click on a file icon and select "file options" from the context menu. In the dialog box you can change the processing type of the file, exclude the file from the build (useful for debugging and error tracing purposes sometimes), attach and configure a Compile Time Script to the file, set specific compiler variables for the file and place short notes for your convenience.

To add a file activate the "Files" window and select "Add file" from the edit menu or just right click anywhere in the files window and select the same menu item. Then browse to the file and click open. You can select more than one file in the open file dialog box. Note that the file must be under the source root specified in the project settings. To allow the IDE to check it automatically save the project before adding any files - it will show a warning message if the file is not under the source root directory.

Removing the file from the list means - it will not be processed and not actually removing the file from the disk. You can remove file from the project by selecting it and choosing "Remove file" from the Edit menu.

All the above actions have a corresponding toolbar button and keyboard shortcut.

Version information

Windows OS supports version information for DLL and other executable modules. If you want to sign your DLL with your company name specify version and additional details you can do it by using the "Version information" dialog box. Open it from the project menu and fill the desired fields. All the fields are optional. You may need accurate version information if you are going to pack your DLL in a setup which will have a chance to replace older versions of the same DLL. Then version numbers are used to compare the files and selection which file to be kept and which to be replaced. For details read the VB help or MSDN version information topics.

Creating project - Step by step

  1. Open the ASPC IDE. It will show the dialog box with the project settings. If you have it already opened then choose "New project" from the file menu.
  2. In the Project settings dialog box specify the settings described on the left side of this page.
    1. By default IDE will apply namespaces for ASP. If you are going to compile an WSH project select the WSH and apply the appropriate namespaces. Or if you want to add/remove some of the namespaces shown - do it before continuing
    2. Enter the source path. Browse to the directory or enter it manually. You can use relative paths to the directory where you are going to save the project.
    3. Enter the destination directory. It will be better to place it outside the source directory - in a separate location in order to avoid mistakes later.
    4. Enter the VB project path - where the VB project files will be generated.
    5. Choose a name for the project. Select something readable but not too long (limit it to approx 20-25 characters). Select something based on the project purpose or/and your company name and remember it will be good to not repeat the same name in another ASPC projects without additional care and directive usage.
    6. Click ok and then save the project. If at least one relative path is entered ASPC will ask you to do it if not select "Save project" from the file menu. If you are using relative paths - find the appropriate location and click "Save".
  3. Now you must add files to your project. Activate the "Files" window and using the Edit menu or the toolbar add the files which will be compiled. Don't forget - they all must be under the source root directory and its subdirectories (see the left side of the page for details).  File dialog box for file adding supplies useful file filter - use them to simplify your work.
  4. Check if the processing options selected automatically are the correct and if not. Edit the file options for these files - Select the desired processing (see the left side of the page for details). Click here to read about the different processing options.
  5. Now you need to save the project.
  6. And you can build it. Select "Build" from the project menu or the toolbar and look at the output window for the compiler responses.
  7. Output window will be filled with various messages - informative and error/warning messages. See the "Output window" for more information on how to use them.
  8. The output finishes with a success or failure message placed after all the other compiler messages. If the build is successful - without fatal errors - depending on the general settings VB will be automatically opened or you will be allowed to start it using the toolbar button or selecting "Open VB" from the project menu.
  9. In VB select make xxxx.DLL from the file menu - where xxxx is the project name you entered in the project settings. If there are errors VB will display them in a message box. In this case better review the ASPC output window for warnings before trying to search the output files. Almost all of the possible error are trapped by ASPC and warning/error description will give you general directions on how to avoid/correct it.
  10. If everything is ok - all the errors are corrected and the DLL was build you can proceed with the application deployment and testing. (see Deployment of the resulting components). VB automatically registers the DLL thus you can test the application easily by creating a virtual directory or virtual site mapped to the output directory of ASPC if you are running your WEB server on the same machine. OR alternatively you can download ALP and test it in-place if it is compatible with it. Of course depending on the other requirements you may need to set-up data sources and so on.

What to read for details over the particular actions:

See the project settings dialog box description.

See the processing options topic.

See the "Output window" topic.

See the errors and warnings reference.

See the ASPC directives if you feel something goes wrong and you need more control over the compilation process - such as class name collisions, problems with some variables etc.

See Execution contexts for details about the differences between the script execution and the component execution. This may help you to improve application or solve some difficult problems. If you are using classes it is strongly recommended. Copyright 2001-2006 newObjects [ ]