[Tool](1.1) Trace RimWorld Core Code

Started by CuteLasty, April 11, 2020, 03:21:52 AM

Previous topic - Next topic

CuteLasty

Prerequirement
Setup debug environment by my post:  [Tool](1.1) Use Visual Studio 2019 to debug your own mods

Decompile RIMWorld Core
I choose JetBrains' dotPeek, because it can generate PDB symbole file.
It's free tool, and you can download here: https://www.jetbrains.com/decompiler/download/

After installed, launch dotPeek.

Step1: Drag and drop RIMWorld\RimWorldWin64_Data\Managed\Assembly-CSharp.dll to dotPeek.
Step2-1: Select Assembly-CSharp on Assembly Explorer
Step2-2: Select menu File/Export to Project
Step2-3: Select export folder, and checked "Create *.pdb file" option
Step3: After export done, then copy [RIMWorld]\[Decompile_Folder]\Assembly-CSharp\Assembly-CSharp.pdb to [RIMWorld]\RimWorldWin64_Data\Managed

Now you can open the solution at [RIMWorld]\[Decompile_Folder]\Assembly-CSharp\Assembly-CSharp.sln by Visual Studio 2019, then attach to Unity debug to trace RIMWorld Core.

You can also trace your mod code at the same time.