-
Notifications
You must be signed in to change notification settings - Fork 4
Publicize Assemblies
WittleWolfie edited this page Mar 16, 2022
·
3 revisions
Publicizing an assembly allows access to private types and members without reflection. This improves performance, simplifies code, and provides type safety.
- Install the NuGet Package
- Open the project's .csproj file and add
<Target Name="Publicize" AfterTargets="Clean">
<ItemGroup>
<!-- Use $(KingmakerPath)\Kingmaker_Data\Managed\Assembly-CSharp.dll for Kingmaker -->
<Assemblies Include="$(WrathPath)\Wrath_Data\Managed\Assembly-CSharp.dll" />
</ItemGroup>
<PublicizeTask InputAssemblies="@(Assemblies)" OutputDir="$(SolutionDir)lib/" />
</Target>
- If you don't have the
KingmakerPath
andWrathPath
environment variables configured you can just use the direct path to the game directory, e.g.C:\Program Files (x86)\Steam\steamapps\common\Pathfinder Second Adventure
- Go to your project properties and check "Allow unsafe code" under Build
- Without this your mod may experience errors or fail to load
- Edit your project file and add a reference to the publicized assembly, replacing the existing reference if it exists:
<Reference Include="Assembly-CSharp">
<HintPath>$(SolutionDir)lib\Assembly-CSharp_public.dll</HintPath>
<Private>False</Private>
</Reference>
- Clean your project
- In Visual Studio:
Build > Clean Solution
- In Visual Studio:
Whenever you need to update the game assembly just Clean your project. You should do this whenever a game update is released.
Note: Reference only the publicized assembly or the original assembly. Referencing both results in numerous errors.
Getting Started
[Wrath] Game Structure
- Abilities
- Blueprints
- Blueprint Components