-
Notifications
You must be signed in to change notification settings - Fork 1
Home
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:
- Service URL: https://nuget-upload.bepinex.dev/
- The service is maintained by the BepInEx organization
- We only store publicised and stripped game assemblies. In other words, we only provide means to distribute games' publically available API definitions. We do not store or manage original game assemblies.
- In case of issues or questions, feel free to join our Discord server.
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:
-
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.
-
Go to https://nuget-upload.bepinex.dev/
Once the page is loaded, you should see the following form:
-
Enter your upload key.
If entered correctly, you will not see any errors:
-
Enter the game version for which you'll upload the assembly.
Allowed format is
X.Y.Z.W
whereW
is optional. -
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
-
-
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. -
View the resulting package.
If upload was successful, you will be prompted to view the uploaded package:
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:
-
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>
-
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
whereN
is automatically incremented by the uploader service.
If you need to target the latest available game libraries, use wildcard*-*
instead of*
. -
Enable
Allow unsafe code
in your projectThis 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>
toPropertyGroup
element.