Skip to content
Truinto edited this page Sep 15, 2023 · 1 revision

Publicizing assemblies

With this you can access any field and method even if they are private.

Install the package 'AssemblyPublicizer', add a job to recompile the game's assemblies, and reference this new file inplace of the original. The original package has a small bug which I encountered for ONI specifically. I made a fix, which you find in this repo 'src/assemblypublicizer.1.0.3.nupkg' (this is the full package plus fix).

Here is the build task: (need to change path to GameManaged)

<PropertyGroup>
  <GameManaged>D:\Programme\Steam\SteamApps\common\OxygenNotIncluded\OxygenNotIncluded_Data\Managed\</GameManaged>
</PropertyGroup>
<Target Name="Publicize" BeforeTargets="PreBuildEvent;Clean" AfterTargets="">
  <ItemGroup>
    <PublicizeInput Include="$(GameManaged)\Assembly-CSharp.dll" />
    <PublicizeInput Include="$(GameManaged)\Assembly-CSharp-firstpass.dll" />
  </ItemGroup>
  <PublicizeTask InputAssemblies="@(PublicizeInput)" OutputDir="$(GameManaged)\" />
</Target>

Also replace the references to the game files, like so. You need to clean or build once for the job (build task) to run. Until then the files won't be there (obviously).

<ItemGroup>
  <Reference Include="Assembly-CSharp_public" HintPath="$(GameManaged)\Assembly-CSharp_public.dll" />
  <Reference Include="Assembly-CSharp-firstpass_public" HintPath="$(GameManaged)\Assembly-CSharp-firstpass_public.dll" />
</ItemGroup>

Clone this wiki locally