MuseDash.Mod.Template
2.0.0
dotnet new install MuseDash.Mod.Template@2.0.0
MuseDash.Mod.Template
A dotnet new template for Muse Dash mods, and MuseDash.Mod.Sdk, the MSBuild SDK that the mods it creates build with.
Prerequisites
- Muse Dash
- MelonLoader, with the game started once so that it has generated the game's assemblies
- .NET 10 SDK, capable of targeting
net6.0 - A C# IDE such as Visual Studio or Rider
Game directory
The SDK finds Muse Dash in your Steam libraries. If it is installed somewhere else, set the MD_DIRECTORY environment
variable to the game's folder, or set GameFolder in a <project>.csproj.user file next to the mod's project (the
template's .gitignore keeps it out of source control):
<Project>
<PropertyGroup>
<GameFolder>D:\Games\Muse Dash</GameFolder>
</PropertyGroup>
</Project>
Install
dotnet new install MuseDash.Mod.Template
Update an installed copy with:
dotnet new update
Create a mod
The template is available as MuseDash Mod in Visual Studio and Rider, or as musedashmod on the command line:
In Visual Studio, find it under Create a new project -> MuseDash Mod:
In Rider, find it under New Solution -> Custom Templates -> MuseDash Mod:
dotnet new musedashmod -n MyMod
No optional package is selected by default. To add one or more useful libraries, repeat --UsefulLibs:
dotnet new musedashmod -n MyMod `
--UsefulLibs MuseDashMirror `
--UsefulLibs UniTask
Options
--Patching: Generate a patch class. Defaults totrue.--Setting: SelectNone,MelonLoader, orTomlet. Defaults toNone.--UsefulLibs: Select any combination of:MuseDashMirrorILRepack: merges the other libraries into the mod's dll, except MuseDashMirror, which players install themselves. Without it, they have to be installed in the game'sUserLibsfolder.UniTask
Selected libraries are pinned to versions that Renovate keeps up to date.
MuseDash.Mod.Sdk
Mods created from the template build with MuseDash.Mod.Sdk. On every build, it finds the game, references MelonLoader
and the game's assemblies, generates MelonInfo and a MelonBuildInfo class from ModName, Version, Authors and
Description, and copies the mod to the game's Mods folder. MelonInfo points at the Main class; if you rename it,
set MelonModType to its full name.
Settings that are not about the game (the artifacts output folder, LangVersion and ImplicitUsings) are in the
template's Directory.Build.props. To share them between several mods in one repository, move it to the repository's
root.
Move a project from an earlier version of the template
- Replace
<Project Sdk="Microsoft.NET.Sdk">with<Project Sdk="MuseDash.Mod.Sdk/{version}">. - Remove the
<Reference>items and theCopyToModsFoldertarget, and remove the game's folders and the<Reference>defaults fromDirectory.Build.props. - Move the values in
MelonBuildInfo.cstoModName,Version,AuthorsandDescription, then deleteMelonBuildInfo.cs,Properties\AssemblyInfo.csand<GenerateAssemblyInfo>false</GenerateAssemblyInfo>. - Replace
ILRepack.targetswith the template's current one, which also merges the NuGet dependencies.
Build the packages
dotnet build MuseDash.Mod.Template.slnx
Both packages are written under artifacts\package\<configuration>, with the same version from MinVer. Install a local build with:
dotnet new install .\artifacts\package\debug\MuseDash.Mod.Template.{version}.nupkg
Mods created from a local build reference the SDK built with it, so add that folder as a package source, for example in a
nuget.config next to the mod:
<configuration>
<packageSources>
<add key="MuseDash.Mod.Local" value="path\to\MuseDash.Mod.Template\artifacts\package\debug"/>
</packageSources>
</configuration>
NuGet caches the SDK by version: after rebuilding without a new commit, delete musedash.mod.sdk from
%UserProfile%\.nuget\packages.
-
net6.0
- No dependencies.
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.