DotNetScript Engine

Using the DotNetScript scripting engine, templates can currently be written in two different languages: C# and VB.Net.

Language Reference

Below are the languages and links to thier respective online references.
Language Help File Online Reference
C# ms-help://MS.NETFrameworkSDKv1.1/csref/html/vcoriCProgrammersReference.htm http://msdn.microsoft.com/.../vcoriCProgrammersReference.asp
VB.Net ms-help://MS.NETFrameworkSDKv1.1/vblr7net/html/vaconProgrammingWithVBNET.htm http://msdn.microsoft.com/.../vcoriCProgrammersReference.asp

Special Tags

When using VB.Net or C#, there are a few custom tags that can be used throughout the code:
Tag Description Example(s)
DEBUG When this tag is added to a template, the template builds in debug mode. <%DEBUG%>
FILE <relativepath> This tag is replaced with the raw contents of relativepath in the template code. <%FILE codeInclude.cs%>
REFERENCE <assemblyname>, ... This tag adds an assembly reference to the template allowing you to access it's contents in code. you can reference custom assemblies by placing them in the same folder as the mygeneration.exe. (or put them in the GAC) <%REFERENCE MyCustomAssembly.dll%>
<%REF MyCustomAssembly.dll, System.Windows.Forms.dll%>
NAMESPACE <namespace>, ... This tag adds an namespace import, much like the "import" command in Vb.Net or the "using" command in C#. <%NAMESPACE System.Diagnostics%>
<%NS System.Diagnostics, System.Collections%>

Debugging

Below is a description of how you can debug your templates with the MicrosoftScript engine.
You can now single step through (debug) your C# and VB.NET templates, and you can do the same for VBScript and JScript templates as well.
Below is the code for a VB.NET template that will invoke the debugger and allow you to single step through your template:
Code:
<%#DEBUG%><% 
Public Class GeneratedTemplate 
         Inherits DotNetScriptTemplate 

   Public Sub New(context As ZeusContext) 
      MyBase.New(context) 
   End Sub 

   Public Overrides Sub Render 
      System.Diagnostics.Debugger.Launch() 
   End Sub 

End Class 
%> 
Notice the first line. It really needs to be formatted exactly as shown below, no white space and all on one line.
<%#DEBUG%><%

The second step is to invoke the debugger, this is done with the line:
System.Diagnostics.Debugger.Launch()

You will then be prompted to the JIT debugging window to choose a debugger, We've tested it with the 2003 CLR debugger, and the Visual Studio Debugger.