Configuring
The default configuration should suffice for most cases, but if you want to change the configuration, you can do so by adding a configuration section handler to the web.config file:
<configSections> <section name="Brail" type="Brail.BrailConfigurationSection, Brail" /> </configSections>
Here is the default configuration for Brail:
<Brail debug="false" saveToDisk="false" saveDirectory="Brail_Generated_Code" batch="true" commonScriptsDirectory="CommonScripts"> <reference assembly="My.Assembly.Name"/> </Brail>
| Option: | Default Value: | Possible values: | |
|---|---|---|---|
| Debug | Generate debug or retail code | false | true - generate debug code false - generate retial code |
| saveToDisk | Save the generated assemblies to disk - useful if you want to know what is going on behind the scenes. | false | true - save assemblies to disk false - use entirely in memory |
| saveDirectory | The directory to save the generated assemblies to. The path can be relative or absolute, if relative, the default ASP.Net bin path will be used. If the directory does not exist, it will be created. | "Brail_Generated_Code" | Any valid path |
| batch | Batch compilation, compile all the scripts in one folder
to a single assembly. This does not work recursively. | true | true - all scripts in a folder will be compiled to a
single assembly false - each script will be compiled to its own assembly |
| commonScriptsDirectory | The directory where all the common scripts are. This can
be a relative or absolute path, if relative, the Views directory of the
application will be used as the base. If the directory does not exist, it will not be created. | "CommonScripts" | Any valid path |
| reference element, assembly attribute | This tells Brails that all your scripts should reference the specified assembly(ies), this allows strong typing in the views and avoid the cost of reflection. | none | The assembly attribute must contains a valid assembly name that is reachable to the application by using Assembly.Load() (usually this means that it's located on the bin directory of the application. |