menu
info Documentation

Developer User Settings

Developer User Settings control how D2S2 compiles and loads user-defined code. These settings are accessed from the User Settings window by selecting the Developer option.

Figure 1: The Developer settings panel within the user settings.

Source Directories

The Source Directories panel lists the folders D2S2 scans for user-defined scripts and model components. Use the folder prompt to add a new directory or select an existing one that already contains custom code.

When a new directory is added, D2S2 automatically creates a .csproj file inside it that references the necessary D2S2 libraries. This project file allows the folder to be opened directly in VSCode as a C# project.

D2S2 monitors all listed source directories for file changes and will attempt to recompile automatically when a change is detected. Compilation errors are reported in the bottom panel of the Model View window.

Reference Assemblies for Visualisation

If you are developing code that renders model objects, check the Include visualisation reference assemblies option. This makes the visualisation libraries available when compiling user code.

Reference Assemblies for Windows Forms

If you are developing code that includes new wizard forms, check the Include Windows Forms reference assemblies option. This makes the Windows Forms libraries available when compiling user code.

Additional Files

If user code relies on external data files or pre-compiled DLL libraries (not required at compile time), these can be included by adding them to the Additional Files list. D2S2 copies the listed files to the same temporary directory as the compiled user code, allowing them to be accessed without hard-coded absolute paths.

Plugin Loading

By default, all licensed plugins are loaded at startup. In some development scenarios — such as when working on code already compiled into an existing plugin — it may be necessary to suppress loading of specific plugins to avoid conflicts. Under the Plugins to load section, select which licensed plugins should be loaded at startup.

Note: A restart is required after making changes to plugin loading options.


Generated User Settings File

Developer settings are persisted to a user settings file (.xml) located in the D2S2 user data directory, typically:

%AppData%\Roaming\D2S2\

This file can be passed to the D2S2 CLI via the --useropts parameter to replicate the same developer environment in headless or automated runs. An example file is shown below:

<UserSettings xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
  <LastEulaAcceptedVer>1</LastEulaAcceptedVer>
  <DeveloperLocations>
    <string>C:/temp/Source</string>
  </DeveloperLocations>
  <ShowUpdateInfo>false</ShowUpdateInfo>
  <DeveloperIncludeVis>true</DeveloperIncludeVis>
  <DeveloperIncludeWinForms>true</DeveloperIncludeWinForms>
  <OptimiseUserCode>false</OptimiseUserCode>
</UserSettings>
Field Description
DeveloperLocations List of source directories. Each path is specified as a <string> entry. Corresponds to the Source Directories panel.
DeveloperIncludeVis When true, includes visualisation reference assemblies. Corresponds to Include visualisation reference assemblies.
DeveloperIncludeWinForms When true, includes Windows Forms reference assemblies. Corresponds to Include Windows Forms reference assemblies.
OptimiseUserCode When true, compiles user code with optimisations enabled. Useful for performance-sensitive scripts in production runs.

See the CLI documentation for more information on using this file with the --useropts parameter.