Plugins Development Getting Started
- TargetProcess is installed on the machine
- NuGet extension for Visual Studio installed
- Visual Studio 2008/2010 is installed
- MSMQ is installed
Visual Studio 2008 Warning
Unfortunately NuGet extension is not available for Visual Studio 2008. You will have to upload NuGet package and add necessary references to your project manually.
- Download nuget.exe (NuGet.exe Command Line bootstrapper)
Run the following command:
nuget install TargetProcessPluginSDK -version <type version here>
(version is optional, nuget will download the latest version if not specified)
- The following folders will appear: TargetProcessPluginSDK.<version>, Common.Logging.1.2.0, Common.Logging.Log4Net.1.2.0, log4net.1.2.10, structuremap.2.6.2
- Create Class Library project in Visual Studio.
- Add reference to all libraries from directories specified above (check Lib subfolders) and NserviceBus.Host.exe as well.
- Go to
TargetProcessPluginSDK.<version>folder and open
- Include file
Tp.Integration.Plugin.Common.dll.configto your project and set Copy to Output Directory property to Copy if newer.
- Do the same with
Profile.csclass to your project and copy content to it from Profile.cs.pp (set correct namespace).
Visual Studio 2010 owners enjoy automatic process:
TargetProcess SDK is available as a NuGet package. Let's create our first sample plugin.
Go to Visual Studio and create a new Class Library project.
Install TargetProcessPluginSDK NuGet package for created project. Right click on the project and select Manage NuGet Packages option. Then search for TargetProcess package in a search input field and click Install button.
Tp.Integration.Plugin.Common.dll.config file and change connection string to:
<configuration> <applicationSettings> <Tp.Integration.Plugin.Common.Properties.Settings> <setting name="pluginDatabaseConnectionString" serializeAs="String"> <value>Data Source=(local);Initial Catalog=TargetProcess;user id=sa;password=sa</value> </setting> </Tp.Integration.Plugin.Common.Properties.Settings> </applicationSettings> </configuration>
Take a look at
Profile.cs class. It contains MyPlugin profile class and sets the plugin name.
Then Run solution with Ctrl + F5.
You may get an error that a project with an output type of class library cannot be started directly. In this case you need to configure debug information for your project. Right click on project → Properties → Debug → Start action, select Start external program and select the following file:
Open web browser and navigate to TargetProcess → Settings → Plugins area and see that ‘My Plugin’ plugin is registered and visible in Plugins list.