Build & Deploy¶
Build¶
The template .csproj already sets the runtime identifier and NativeAOT, so no extra switches are needed. The equivalent explicit command is:
Output files¶
Published to bin/Release/net8.0-windows/win-x86/publish/:
| File | Purpose |
|---|---|
MyPlugin.dll |
The native DLL. Deploy this file |
MyPlugin.pdb |
Debug symbols, optional for crash analysis |
MyPlugin.exp, .lib |
Linker artifacts, not needed at runtime |
Build machine requirements
NativeAOT requires the Visual C++ build tools (MSVC). Install "Desktop development with C++" from the Visual Studio Installer.
Required .csproj settings¶
<PropertyGroup>
<OutputType>Library</OutputType>
<TargetFramework>net8.0-windows</TargetFramework>
<RuntimeIdentifier>win-x86</RuntimeIdentifier>
<PublishAot>true</PublishAot>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<Nullable>enable</Nullable>
</PropertyGroup>
HydroSym is a 32-bit application, so the plugin must be win-x86. A 64-bit DLL fails to load.
When you reference PARO.HydroSym.PluginSDK with PublishAot set to true, the package compiles the two native entry points HydroSym looks for (HydroSymPlugin_Invoke and HydroSymPlugin_SetHostCallback) into your DLL. You do not write those exports yourself.
Register the plugin class once at startup with PluginRegistration.Register from a [ModuleInitializer], as in the template Startup.cs. Without that, the load fails and the warning dialog reports "No plugin registered".
Deployment layout¶
C:\ProgramData\PARO\HydroSym\Plugins\
└── MyPlugin\
├── MyPlugin.dll
└── plugin.ini ← plugin config (optional)
Keep each plugin in its own subdirectory. The location is a convention; HydroSym loads whatever DllPath points to.
Paths: DLL vs app data¶
| Path | Purpose |
|---|---|
C:\ProgramData\PARO\HydroSym\Plugins\ |
Where you deploy the plugin DLL |
%APPDATA%\PARO\HydroSym\ |
Per-user application data, passed as InitializeRequest.HostDataPath (with a trailing backslash) |
ConfigPath in the INI |
Your plugin's config file, passed as InitializeRequest.ConfigPath |
Register in HydroSym.ini¶
Edit %APPDATA%\PARO\HydroSym\Ini\HydroSym.ini:
[Plugin]
Enabled=1
DllPath=C:\ProgramData\PARO\HydroSym\Plugins\MyPlugin\MyPlugin.dll
ConfigPath=C:\ProgramData\PARO\HydroSym\Plugins\MyPlugin\plugin.ini
| Key | Description |
|---|---|
Enabled |
1 to load the plugin. 0 or absent: nothing is loaded and no message is shown |
DllPath |
Absolute path to the plugin DLL. Environment variables such as %ProgramData% are not expanded |
ConfigPath |
Passed to Initialize as request.ConfigPath. Optional; HydroSym does not read the file itself |
HydroSym loads one plugin. Implement all integrations in a single DLL.
Plugin config file¶
Read request.ConfigPath in Initialize. Any format works; HydroSym only passes the path. Example plugin.ini:
Troubleshooting¶
A load failure (missing INI, empty DllPath, missing exports, GetInfo or Initialize error, apiVersion too high) shows a modal warning: "Plugin failed to load: ... HydroSym will continue without plugin integration." The text after the colon is the error message, so read it first.
HydroSym does not write a plugin log file. Write your own log from the plugin if you need diagnostics from a customer machine.
After you change the plugin, republish, copy the DLL over the registered DllPath, and restart HydroSym. There is no reload while HydroSym is running.
Plugin menu does not appear
- Read the warning dialog on startup.
- Verify
Enabled=1and thatDllPathis the exact absolute path of the DLL. - Run
dumpbin /exports MyPlugin.dlland verify bothHydroSymPlugin_InvokeandHydroSymPlugin_SetHostCallbackare exported. - Check that at least one menu item has
Location = "plugin". Items infileortoolsdo not create the plugin menu.
HydroSymPlugin_Invoke or HydroSymPlugin_SetHostCallback not found
The DLL was not published with NativeAOT, or PARO.HydroSym.PluginSDK is not referenced. Confirm PublishAot is true and RuntimeIdentifier is win-x86.
Load fails with "No plugin registered"
PluginRegistration.Register was not called. Add the [ModuleInitializer] from the template Startup.cs.
Access violation on startup
A crash in GetInfo or Initialize. Attach the debugger to HydroSym.exe before the plugin loads.
Optional method never called
Add the matching capability to GetInfo.capabilities, or use DeriveCapabilities(). Lifecycle and menu methods are not capability-gated.