Where to deploy
Where to deploy
The folder SabrTrader loads plugins from, the SDK's opt-in MSBuild deploy target, copying by hand, and which files belong in the folder.
The plugin folder
SabrTrader loads plugins from one folder in your Documents folder:
plugin folderDocuments\SabrTrader\Plugins\
"Documents" is the folder Windows reports as your Documents folder, so if it is redirected (for example to OneDrive), the plugin folder moves with it. The platform creates the folder at startup if it does not exist. The folder is outside the installation directory, so application updates leave your plugins in place.
-
Top level only. The platform loads the
*.dllfiles directly in the folder. Subfolders are ignored. - Every DLL is treated as a plugin. Each DLL in the folder is loaded and inspected for plugin types. A DLL that contains none (a third-party library, for example) registers nothing.
-
Built-in names are reserved. A DLL with the same file name as one of the platform's built-in
plugin assemblies (for example
SabrTrader.Pipeline.BuiltIns.dll) is skipped. Give your assembly its own name. - Loaded while running. The platform watches the folder. A DLL copied in or rebuilt while SabrTrader runs is loaded about a second after the file stops changing; see The build and reload loop.
- Never locked. The platform loads a copy of each DLL, so the files in the folder stay writable while SabrTrader runs.
Auto-deploy from MSBuild (opt-in)
The SabrTrader.Sdk package brings in an MSBuild .targets file automatically.
It defines one opt-in target, DeploySabrTraderPlugin, that runs after every build and
copies your built DLL (and its .pdb when present) into the plugin folder, creating the
folder if needed. It does nothing until you set the property.
Turn it on in your plugin .csproj:
XML: YourPlugin.csproj<PropertyGroup>
<DeploySabrTraderPlugin>true</DeploySabrTraderPlugin>
</PropertyGroup>
The destination defaults to SabrTrader\Plugins inside your real Documents folder, the
same folder the platform watches. The target looks up where your Documents folder really is, so one
redirected to OneDrive or a network share works without extra settings. To deploy somewhere else, set
SabrTraderPluginsFolder:
XML: YourPlugin.csproj<PropertyGroup>
<DeploySabrTraderPlugin>true</DeploySabrTraderPlugin>
<SabrTraderPluginsFolder>D:\dev\sabrtrader-plugins</SabrTraderPluginsFolder>
</PropertyGroup>
DeploySabrTraderPlugin and
SabrTraderPluginsFolder, as defined in the package's
SabrTrader.Sdk.targets. Type them exactly as written.
The build log shows where each build went:
build logSabrTrader.Sdk: deploying plugin 'YourPlugin.dll' to 'C:\Users\you\Documents\SabrTrader\Plugins'
Manual copy
To keep your build independent of the plugin folder, leave DeploySabrTraderPlugin off
(its default) and copy the DLL yourself after each build:
PowerShellCopy-Item bin\Release\net10.0\YourPlugin.dll "$([Environment]::GetFolderPath('MyDocuments'))\SabrTrader\Plugins\"
The running platform picks up the copy on its own. The auto-deploy target does the same thing: it copies the primary output assembly and its PDB.
What to put in the folder
Copy your plugin's own DLL, optionally its .pdb (exceptions in the log then carry file
names and line numbers), and any third-party library your plugin needs that the platform does not
provide. Leave out everything the platform already provides.
| File | Ship it? |
|---|---|
YourPlugin.dll |
Yes. This is the plugin. |
YourPlugin.pdb |
Optional, for readable stack traces. |
| A third-party library the platform does not provide | Yes. See Dependencies & isolation. |
SabrTrader.Pipeline.Contracts.dll and the other SDK contract assemblies |
No. The platform provides them and binds your plugin to its own copies. |
YourPlugin.deps.json |
Not needed. Third-party libraries next to your DLL are found by file name. |
The whole bin output folder |
No. Every DLL in the folder is loaded as a candidate plugin, so extra files only slow down loading and clutter the log. |
AssemblyLoadContext, but any assembly the platform ships (the SDK contract assemblies
among them) always resolves to the platform's copy. That keeps IIndicator,
Strategy and every other contract type identical on both sides. A contract DLL you copy
into the plugin folder is never used by your plugin. The next page explains the resolution rules.