Set Up a Plugin Environment
This page explains how to prepare a SecRandom plugin development environment and create a minimal plugin project.
Prerequisites
Section titled “Prerequisites”- .NET 10 SDK or later.
- An IDE that supports .NET, such as JetBrains Rider or Visual Studio.
- Basic knowledge of C# and Avalonia (plugin pages are built with Avalonia controls).
Reference the SDK
Section titled “Reference the SDK”SecRandom plugins reference the host API through the NuGet package SecRandom.PluginSdk. Add the following to your plugin project:
<PackageReference Include="SecRandom.PluginSdk" Version="3.1.0"> <ExcludeAssets>runtime;native</ExcludeAssets></PackageReference>ExcludeAssets="runtime;native"keeps the SDK package compile-time only; the runtime assemblies your plugin needs (such asSecRandom.Core) are supplied in-process by the host.- Package versions follow the main application; use the version that matches your app (the latest published package is
3.1.0, and plugin API3.1.5corresponds tov3.1.5). Only the major version ofapiVersionis compared, and the current plugin API major is3. - Plugins use the host-exposed capabilities through the SDK, which are the Core contracts the SDK references.
Get the Minimal Template
Section titled “Get the Minimal Template”SECTL/SecRandom-ExamplePlugins is the standalone example plugin repository: it registers a single settings page that displays the plugin’s own information. Use it as a starting point:
git clone https://github.com/SECTL/SecRandom-ExamplePlugins.gitcd SecRandom-ExamplePluginspowershell -ExecutionPolicy Bypass -File scripts\build.ps1The build produces ExamplePlugin\srpx\SecRandom.ExamplePlugin.srpx. The SecRandom.ExamplePlugin inside the main application repository is the same template kept in-tree, useful for reading alongside.
Local Debugging
Section titled “Local Debugging”During development you don’t need to repeatedly package and install:
- Use the startup argument
--epp <directory>(or--externalPluginPath <directory>, repeatable) to add a development plugin directory: point it at the parent directory that contains your plugin directories, since the host only enumerates its subdirectories. Plugins there are loaded in place; the host never moves or deletes them. Restart the application after changing code. - Alternatively, place a packaged
.srpxindata/cache/plugin-packagesand restart the desktop application to install it.
Next Steps
Section titled “Next Steps”Read Create a Plugin to learn the plugin project structure, or jump straight to the Plugin Entry Class and Capabilities.