6 Development
あかニャン edited this page 2024-07-02 19:52:33 +00:00

Setup

Common should have the following files:

└───Assembly-CSharp_unpacked
    └───Assembly-CSharp_unpacked.csproj
└───mu3
    ├───mu3.exe
    └───BepInEx
├───Assembly-CSharp-firstpass.dll
├───mscorlib.dll
├───UnityEngine.dll
└───UnityEngine.UI.dll

The unpacked assembly can be found here and unzipped with dotPeek/ILSpy.

The DLLs can be copied from mu3/mu3_data/Managed.

mu3 can be symlinked/junctioned.

Once Common is set up, run dotnet restore in the root directory and in Assembly-CSharp_unpacked, and open the solution in MSVS or VSCode or whatever. The DLLs will be copied to mu3/BepInEx/monomod post-build automatically.

Best practices

Troubleshooting

The type or namespace name could not be found

If you are getting a bunch of these errors, something may be wrong with your decompiled assembly, or my setup is wrong. Someone knowledgeable with dotnet could perhaps explain it (I'm just a tourist). A potential workaround is to add the unpacked assembly DLL to Common and reference it in project files:

<Reference Include="Mu3Assembly"><HintPath>..\Common\Assembly-CSharp_unpacked.dll</HintPath></Reference>