Skip to main content

Setup

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

Requirements

  • .NET 7
  • An IDE supporting C#
    (This guide will be based on JetBrains Rider, but any other IDE is fine as well)

CLI

To greatly simplify some steps, we will install the MoBro Plugin CLI first.
This CLI provides an easy way to test and publish MoBro plugins, and we will use it in some future steps.

The CLI is available on NuGet and can be installed by a single command:

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

The CLI is not required to create a MoBro plugin and alternative methods will be outlined in this tutorial whenever the CLI is used.
However the CLI simplifies certain tasks by a lot since we specifically created it for that purpose.

Project setup

In your IDE, simply create a new and empty .NET Core console application. Select the following parameters:

  • SDK: 7.0
  • Language: C#
  • Framework: net7.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

Dependencies

To develop our plugin we will need the MoBro plugin SDK. So let's add it as a dependency.
The SDK is available on Nuget, so we can simply add it to the .csproj file like so:

Plugin.Example/Plugin.Example.csproj

<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net7.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="MoBro.Plugin.SDK" Version="0.3.0" PrivateAssets="all"/>
</ItemGroup>
</Project>
info

Since we do not need to include the SDK when we publish our plugin, we add it as private asset.