Skip to content
This repository was archived by the owner on May 9, 2023. It is now read-only.
Sinai edited this page Jan 31, 2022 · 15 revisions

Using the NuGet package

To use UniverseLib, add the NuGet Package to your project.

UniverseLib has two release files: UniverseLib.IL2CPP.dll which targets .NET 4.7.2, and UniverseLib.Mono.dll which targets .NET 3.5. These files are both included in the same NuGet package.

IL2CPP-only projects:

  • Your project should target .NET 4.7.2 or greater, simply add a reference to the NuGet package.

Mono-only projects using .NET <4.7.2

  • If your project targets any .NET version less than 4.7.2, simply add a reference to the NuGet package. Universal Mono mods should aim at targeting .NET 3.5 for maximum compatibility with all Unity versions.

Mono-only projects using .NET 4.7.2 or newer

  • Add the UniverseLib NuGet package.
  • Change the packages.config entry for UniverseLib to use targetFramework="net35".
  • Manually change the reference in your .csproj file to point to the packages/UniverseLib.X.X.X/net35/UniverseLib.Mono.dll file instead of the IL2CPP file. Take note of the net35 folder in the path as well as the .Mono.dll ending.
  • When updating the UniverseLib package, take consideration to your .csproj file and make sure it is pointing to the correct version and file, as your IDE may incorrectly change it on updates or not change it at all.

Mono+IL2CPP projects:

  • You will need two build configurations for your project, one for IL2CPP and one for Mono.
  • Add the NuGet package.
  • Edit your .csproj file and change the UniverseLib reference. You will need references in two separate conditional PropertyGroups so that each configuration targets the correct DLL. For an example project, see BepInExConfigManager or MelonPreferencesManager.
  • When updating the UniverseLib package, take consideration to your .csproj file and make sure it is pointing to the correct versions and files, as your IDE may incorrectly change it on updates or not change it at all.

Clone this wiki locally