Omamori.ModBuildConfig 0.1.0-alpha.5

This is a prerelease version of Omamori.ModBuildConfig.
dotnet add package Omamori.ModBuildConfig --version 0.1.0-alpha.5
                    
NuGet\Install-Package Omamori.ModBuildConfig -Version 0.1.0-alpha.5
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Omamori.ModBuildConfig" Version="0.1.0-alpha.5">
  <PrivateAssets>all</PrivateAssets>
  <IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
</PackageReference>
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Omamori.ModBuildConfig" Version="0.1.0-alpha.5" />
                    
Directory.Packages.props
<PackageReference Include="Omamori.ModBuildConfig">
  <PrivateAssets>all</PrivateAssets>
  <IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
</PackageReference>
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Omamori.ModBuildConfig --version 0.1.0-alpha.5
                    
#r "nuget: Omamori.ModBuildConfig, 0.1.0-alpha.5"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Omamori.ModBuildConfig@0.1.0-alpha.5
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Omamori.ModBuildConfig&version=0.1.0-alpha.5&prerelease
                    
Install as a Cake Addin
#tool nuget:?package=Omamori.ModBuildConfig&version=0.1.0-alpha.5&prerelease
                    
Install as a Cake Tool

Omamori.ModBuildConfig

Build setup for Omamori mods for osu!lazer

<Project Sdk="Microsoft.NET.Sdk">
  <PropertyGroup>
    <TargetFramework>net10.0</TargetFramework>
  </PropertyGroup>
  <ItemGroup>
    <PackageReference Include="Omamori.ModBuildConfig"          Version="x.y.z" />
  </ItemGroup>
</Project>

Put a mod.json next to the project. Build with the dotnet cli, Visual Studio's msbuild skips checking mod.json, deploying and zipping.

Property Default
OmamoriGamePath where osu!lazer is installed the folder containing osu.Game.dll
OmamoriDataPath osu!'s data folder where omamori/mods/ is
OmamoriDeploy false true copies the mod into $(OmamoriDataPath)/omamori/mods/<id>/ after each build, replacing what's there
OmamoriPackMod true for Release zips the mod as <id>-<version>.zip to extract into omamori/mods/
OmamoriHarmony false true lets the mod patch osu! with Harmony, see below

Deploy and the zip take everything in the build output, including content files, runtimes/ and translated resources.

Using another mod's services

Declare the other mod in mod.json's dependencies, then reference its dll without bundling it, so both mods share one copy of its types:

<ItemGroup>
  <OmamoriModReference Include="$(OmamoriDataPath)\omamori\mods\yourname.othermod\OtherMod.dll" />
</ItemGroup>

Patching osu!

When the API doesn't cover something, a mod can patch the game with Harmony. Omamori loads one Harmony for every mod, so don't add the Lib.Harmony package. Set OmamoriHarmony instead, which compiles against Omamori's copy and never bundles it:

<PropertyGroup>
  <OmamoriHarmony>true</OmamoriHarmony>
</PropertyGroup>

Add Patches to capabilities in mod.json too, so players can see the mod changes osu!'s code. The build fails without it.

dotnet new omamori-mod --harmony starts a mod with both set and an example patch.

Apply patches from Load with your mod id as the Harmony id. If your mod crashes, Omamori removes its patches with the rest of it:

new Harmony(context.Manifest.Id).CreateClassProcessor(typeof(MyPatch)).Patch();

To reach lazer's private members, publicize them with Krafs.Publicizer instead of using reflection, so a rename in an osu! update breaks your build rather than your mod:

<PropertyGroup>
  <PublicizerRuntimeStrategies>IgnoresAccessChecksTo</PublicizerRuntimeStrategies>
</PropertyGroup>
<ItemGroup>
  <PackageReference Include="Krafs.Publicizer" Version="2.3.2" PrivateAssets="all" />
  <Publicize Include="osu.Game:osu.Game.Screens.Menu.IntroScreen.LoadMenu" />
</ItemGroup>

Libraries osu! already has

Any package that osu!lazer also ships is compiled against the game's copy and never bundled, since only one copy can load. To keep your own copy of one anyway, for example a test framework in a test project:

<ItemGroup>
  <OmamoriOwnCopy Include="nunit.framework" />
</ItemGroup>
There are no supported framework assets in this package.

Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
0.1.0-alpha.5 44 11/11/2026
0.1.0-alpha.4 53 11/2/2026
0.1.0-alpha.3 57 10/30/2026
0.1.0-alpha.2 53 10/30/2026
0.1.0-alpha.1 58 10/30/2026