Creating a Project
Creating a mod for Resonite is simple using the official BepInEx template. This guide covers installing the template, generating a project, and configuring it for development.
Installing
Section titled “Installing”.NET templates must be installed before they can be used. This means that when you install the template, it doesn’t create a new project for you, but you will get the ability to do that.
Once you have the template installed, you don’t need to install it again, through it’s a good idea to update it if there are updates.
See the BepInEx Template repository
From NuGet (Recommended)
Section titled “From NuGet (Recommended)”Install the template from the Resonite modding NuGet feed:
dotnet new install BepInEx.Templates::2.0.0-be.* --nuget-source https://nuget-modding.resonite.net/v3/index.json
Manual Install
Section titled “Manual Install”If you’re contributing to the template or prefer manual installation:
- Clone or download this repository
- Navigate to the
BepInEx.Templates
folder - Run:
cd BepInEx.Templatesdotnet new install .
To update:
git pulldotnet new install . --force
To uninstall:
dotnet new uninstall .
Once installed, the template will be available as BepInEx 6 Resonite Plugin
with the short name bep6resonite
.
Creating a New Mod
Section titled “Creating a New Mod”Run the following command in your Resonite modding directory:
dotnet new bep6resonite --name MyPluginName --authors "MyName" --packageId net.myname.mypluginmame --repositoryUrl "https://github.com/myuser/mymod"
This will create a new folder called MyPluginName
with your mod’s project.
Template Options
Section titled “Template Options”You can customize your project with these options:
-ve|--version
- Plugin version (default: 1.0.0)-au|--authors
- Comma-separated list of plugin authors (default: YourName)-r|--repositoryUrl
- Repository URL (auto-generated ashttps://github.com/[FirstAuthor]/[ProjectName]
if empty)-p|--packageId
- Package ID (auto-generated as[FirstAuthor].[ProjectName]
if empty)-g|--gitInit
- Initialize a git repository (default: true)
Project Structure
Section titled “Project Structure”This example demonstrates creating a project with the template:
~/Workspace/Resonite$ dotnet new bep6resonite -n ResoniteModThe template "BepInEx 6 Resonite Plugin (.NET 9, Thunderstore Ready)" was created successfully.
After creation, you’ll see helpful next steps instructions. Now let’s look at the project structure:
~/Workspace/Resonite$ cd ResoniteMod/
The file structure in ResoniteMod/
should look like this:
- .gitignore
- CHANGELOG.md
- Directory.Build.targets
- icon.png
- LICENSE
- README.md
- ResoniteMod.sln
- thunderstore.toml
Directory.config/
- dotnet-tools.json
Directorysrc/
DirectoryResoniteMod/
- Plugin.cs
- ResoniteMod.csproj
Key points:
- Your mod code is in
./src/<project-name>/
Directory.Build.targets
file definesPackTS
target, see the Packaging and Publishing guide<project-name>.sln
is your project solution
The project is configured so that it’s easy to add new projects into your project solution. Even if you don’t need that, it’s good to follow this standard project structure.
Post-Creation Setup
Section titled “Post-Creation Setup”After creating your project, the template provides helpful instructions:
- Set up game path: Either set
ResonitePath
environment variable or updateGamePath
in the .csproj - Review metadata: Update project metadata in the .csproj file (Version, Authors, etc.)
- Replace TODOs: Search for
TODO
comments in the generated template and replace them with your actual values - Build: Run
dotnet build
- this automatically copies the plugin to BepInEx/plugins folder
Automatic Game Path Detection
Section titled “Automatic Game Path Detection”The template automatically finds your Resonite installation:
- First checks the
ResonitePath
environment variable - Falls back to Steam installation paths
- Uses NuGet package for game references if local install not found
Build Configuration
Section titled “Build Configuration”Your plugin metadata is automatically generated from .csproj
properties:
PackageID
→ Plugin GUIDProduct
→ Plugin NameVersion
→ Plugin VersionAuthors
→ Plugin AuthorsRepositoryUrl
→ Repository URL
Thunderstore Packaging
Section titled “Thunderstore Packaging”The template includes built-in Thunderstore packaging support. Your project comes with:
thunderstore.toml
- Package configurationicon.png
- Your mod’s icon (replace with your own 256x256 image)- Build targets for creating and publishing packages
For detailed packaging and publishing instructions, see the Packaging and Publishing guide.