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>
HydroMan is a 32-bit application, so the plugin must be win-x86. A 64-bit DLL fails to load.
When you reference PARO.HydroMan.PluginSDK with PublishAot set to true, the package compiles the two native entry points HydroMan looks for (HydroManPlugin_Invoke and HydroManPlugin_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\Hydroman\Plugins\
└── MyPlugin\
├── MyPlugin.dll
└── plugin.ini ← plugin config (optional)
Keep each plugin in its own subdirectory. The location is a convention; HydroMan loads whatever DllPath points to.
Paths: DLL vs app data¶
| Path | Purpose |
|---|---|
C:\ProgramData\PARO\Hydroman\Plugins\ |
Where you deploy the plugin DLL |
%APPDATA%\PARO\Hydroman\ |
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 Hydroman.ini¶
Edit %APPDATA%\PARO\Hydroman\Ini\Hydroman.ini:
[Plugin]
Enabled=1
DllPath=C:\ProgramData\PARO\Hydroman\Plugins\MyPlugin\MyPlugin.dll
ConfigPath=C:\ProgramData\PARO\Hydroman\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; HydroMan does not read the file itself |
HydroMan loads one plugin. Implement all integrations in a single DLL.
Plugin config file¶
Read request.ConfigPath in Initialize. Any format works; HydroMan 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: ... HydroMan will continue without plugin integration." The text after the colon is the error message, so read it first.
HydroMan does not write a plugin log file and discards host-side plugin log messages. 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 HydroMan. There is no reload while HydroMan 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 bothHydroManPlugin_InvokeandHydroManPlugin_SetHostCallbackare exported. - Check that at least one menu item has
Location = "plugin". Items infileortoolsdo not create the plugin menu.
HydroManPlugin_Invoke or HydroManPlugin_SetHostCallback not found
The DLL was not published with NativeAOT, or PARO.HydroMan.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 Hydroman.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.