-
Notifications
You must be signed in to change notification settings - Fork 6
Building a Plugin
A plugin needs to be built as a "Class Library (.NET Framework)".
The Target Framework should be a recent ".NET Framework".
The platform target should be "Any CPU".
The Visual Studio project for building the plugin must include the Assembly for PluginInterfaces
as a reference.
The project must include the Assembly for EmbeddedUiPluginInterfaces
as a reference if it is using one of the interface classes that displays data in a Paratext window.
The assemblies can be found in the NuGet manager. Below are links to the assemblies:
After building a project to generate the plugin, it is necessary to copy the .dll file (and .pdb file if you are interested in debugging) to a folder for that plugin under the plugins
folder for the Paratext installation. When copying the .dll file, it must be renamed to use the .ptxplg file extension so that it is recognized by Paratext. Paratext must not be running when doing these copies.
If you want the .dll and .pdb files to be automatically copied over then do the following:
- Go to the Properties of the plugin project in Visual Studio.
- Navigate to the Build Events tab.
- In the Post-build event command line textbox paste:
- xcopy "$(TargetPath)" "%ParatextInstallDir%\plugins$(ProjectName)*.ptxplg" /y /i
- This will automatically copy the .dll file
- xcopy "$(TargetDir)$(TargetName).pdb" "%ParatextInstallDir%\plugins$(ProjectName)" /y /i
- This will automatically copy the .pdb file. The .pdb file is only necessary for debugging.
- xcopy "$(TargetPath)" "%ParatextInstallDir%\plugins$(ProjectName)*.ptxplg" /y /i
- Note: there will need to be one copy per .dll file and .pdb file needed by the plugin.