Shortcut to Main Page

Reference:
Compile Options

The compile options (BuildOptions object) exposes a number of settings that determine how the code for your document is internally compiled.

Possible Settings for Compile Options

In most basic cases, you don't have to do anything else to execute code as you write it. Simply type in expressions or statements as required, build the documents or run the code and the program will evaluate and display the results.

In some cases, it will be necessary to change some settings. To do so, make sure the Properties Window is visible (View | Properties Window, or F4 key), and select Compile Options in the drop-down list. The Properties Window displays several pairs of settings and their values (Figure 1).

Properties Window
Figure 1. The Properties Window displaying document compile options.

Imports

Lists all namespaces imported (using directives, Imports directives). Some namespaces are already listed in the namespace selector, so you can check them in one click instead of full typing them every time.

Note: This property also applies to the UserCode property, but does NOT apply to referenced source files. Source files must include their own namespace import statements.

IncludeDebugInfo

If true, makes debugging info (symbols and source code) available to use in a .NET debugger. Enable debugging info to spot errors in documents with large amount of code. The default is false.

Language

Choose from the .NET languages installed on your machine. Languages installed with the .NET Framework are C#, VB.NET and JScript. Languages such as J# may be installed separately. The default language is C#.

Namespace

The namespace in which to build the code.

References

  1. The Reference selector lists all assemblies referenced in the active document. mscorlib.dll is always referenced and does not appear in the references list (Figure 2).
  2. The drop-down button just right of the Add/Browse button provides shortcuts to folders where common .NET libraries are located. Shortcuts point to the application directory, the document directory (if available) and the installation folder of the utilized .NET version.

Reference Selector
Figure 2. Reference selector (Referenced Assemblies).

SourceFiles

Lists all files which contain source code used by the input. Useful to maintain some reusable source code without having to compile it in a library. The user interface for the source file selector is very similar to the assembly reference selector (Figure 2).

UserCode

Contains any additional class declarations you need. To edit the user code, display the Code Pane by clicking the Code view button, or by activating View | Code in the menu, and look for the BuildOptions | UserCode in the Fragments tree.

Note: Code in the UserCode section should be ready to build as if it was a separate file, independently from any document code. Namespaces listed in the Imports property will apply to the user code section, but you must explicitly import the namespaces in the referenced source files.