Skip to main content

Setup

In this section, we will create the basic project setup and add all the required dependencies.

Requirements

To follow this guide, you will need the following:

  • .NET 8
  • An IDE supporting C#
    This guide uses JetBrains Rider as an example, but any other IDE (e.g., Visual Studio, Visual Studio Code) will work as well.

CLI Tool: MoBro Plugin CLI

To simplify some steps in the process, we recommend installing the MoBro Plugin CLI.
This CLI tool is designed to make it easier to test and publish MoBro plugins. We will rely on it in certain future steps.

You can install the CLI directly from NuGet using the following command:

dotnet tool install --global MoBro.Plugin.Cli
info

The MoBro Plugin CLI is optional for creating a plugin.
While this guide provides alternative methods for every CLI-related step, using the CLI simplifies many tasks, as it was specifically designed for this purpose.


Project Setup

Creating the Project

Open your chosen IDE and create a new .NET Core Console Application. Use the following parameters during setup:

  • SDK: 8.0
  • Language: C#
  • Framework: net8.0
  • Docker Support: Disabled

Project structure

After creating the console application, your project should contain the following:

Plugin.Example
├── bin
├── obj
├── Plugin.Example.csproj
└── Program.cs

Adding Dependencies

To develop a MoBro plugin, you need to include the MoBro Plugin SDK as a dependency. This SDK is available on NuGet and can be added to your .csproj file.

Update your .csproj file with the following configuration:

Plugin.Example/Plugin.Example.csproj

<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="MoBro.Plugin.SDK" Version="1.0.1" PrivateAssets="all"/>
</ItemGroup>
</Project>
info

The PrivateAssets="all" flag ensures that the SDK is not included when publishing the plugin. This helps keep the published plugin lightweight.