Skip to content
Geoffrey Horsington edited this page Mar 26, 2022 · 13 revisions

BepInEx NuGetUpload service allows modding communities to upload and maintain publicised and stripped game assemblies on BepInEx NuGet feed.

The service is intended for Unity game modding communities to generate and distribute game-specific assemblies easily.
Basic information:

How to upload game assemblies

This guide is intended for modders who want to upload game-specific assemblies to BepInEx NuGet feed.
If you are an end-user who wants to consume packages, refer to how to include packages into your project.

Do the following:

  1. Obtain the upload key.

    To upload game assemblies, you'll first need an upload key. To obtain one, fill out and send a key request form.

    NOTE: The upload key is multi-use and is valid for as long as you actively maintain the package. Keep the key secured, but feel free to share it with other modding community members who are willing to help with maintaining the package.

    If the key is lost or compromised, feel free to resubmit the form with a request to reset the key.

  2. Go to https://nuget-upload.bepinex.dev/

    Once the page is loaded, you should see the following form:

  3. Enter your upload key.

    If entered correctly, you will not see any errors:

  4. Enter the game version for which you'll upload the assembly.

    Allowed format is X.Y.Z.W where W is optional.

  5. Select assemblies to upload.

    Click Choose files and select all assemblies that you will want to include in the package.

    What assemblies you should upload

    • For UnityMono games: Upload original game assemblies that are not publicised and not stripped. The assemblies will be automatically stripped and publicised before they are pushed to NuGet.

    • For Il2Cpp games: Upload dummy assemblies generated by Cpp2IL. Use the following command line options to generate the relevant DLLs:

      Cpp2IL --game-path <path to game path> --exe-name <name of the game exe> --skip-analysis --skip-metadata-txts --disable-registration-prompts
      

  6. Click Upload.

    If everything is correct, the Upload button will become clickable. Clicking on will begin the upload process. If any errors occur, you will be notified of them.

  7. View the resulting package.

    If upload was successful, you will be prompted to view the uploaded package:

How to download game assembly packages

In order to use the package from https://nuget.bepinex.dev/, you will need to configure NuGet to add it as an additional source.

Note: Alternatively, use BepInEx.Templates template pack which includes BepInEx plugin templates with preconfigured NuGet settings.

For C# projects, do the following:

  1. Create NuGet.Config in your solution folder.

    Add the following contents (or edit your existing file to include the new source):

    <?xml version="1.0" encoding="utf-8"?>
    <configuration>
      <packageSources>
        <add key="BepInEx" value="https://nuget.bepinex.dev/v3/index.json" />
      </packageSources>
    </configuration>
  2. Add package references normally.

    Use your IDE to add the packages normally. You should be able to search for all packages available on BepInEx NuGet feed

    NOTE: NuGet package versions will be of format X.Y.Z.W-r.N where N is automatically incremented by the uploader service.
    If you need to target the latest available game libraries, use wildcard *-* instead of *.

  3. Enable Allow unsafe code in your project

    This is needed so that your code can access private members at runtime.

    If you use new csproj format, you can simply add <AllowUnsafeBlocks>true</AllowUnsafeBlocks> to PropertyGroup element.

Clone this wiki locally