Skip to content
This repository was archived by the owner on May 9, 2023. It is now read-only.
Sinai edited this page Jan 30, 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:

  • If your project targets any .NET version less than 4.7.2, simply add a reference to the NuGet package.
  • If your project targets .NET 4.7.2 or greater, you will need to 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.
  • 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.

Mono+IL2CPP projects:

  • You will need two build configurations for your project, one for IL2CPP and one for Mono.
  • Add the NuGet package, then remove the reference to UniverseLib if it was automatically added by your IDE to the project.
  • Add the references in 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.

Clone this wiki locally