🏒
Puck
  • Welcome!
  • GETTING STARTED
    • Development environment setup
    • Using the Puck API
    • Testing your mod
    • Development optimizations
  • PUBLISHING
    • SteamWorkshopUploader
    • Publishing to the Steam Workshop
  • Puck API
    • Singletons
    • Harmony
    • Referencing the source
Powered by GitBook
On this page
  • C# Dev Kit
  • Copy the built MyPuckMod.dll to Plugins automatically
  1. GETTING STARTED

Development optimizations

C# Dev Kit

In case you're using Visual Studio Code as your development IDE, make sure to install the C# Dev Kit extension. It will enable multiple QOL features when working with C# projects, such as code-completion, C# project and solution management and more.

In the previous guides, we build our mod by manually typing dotnet build in the terminal, but this extensions also allows us to quickly build the project by hitting CTRL + SHIFT + B.


Copy the built MyPuckMod.dll to Plugins automatically

After our mod is build, we have to manually move the built MyPuckMod.dll file to the Plugins directory in order to test our changes. This process can be automated by adding the following tags to our MyPuckMod.csproj:

<Target Name="PostBuildMoveDll" AfterTargets="Build">
  <PropertyGroup>
    <TargetDir>C:\Program Files (x86)\Steam\steamapps\common\Puck\Plugins\MyPuckMod</TargetDir>
  </PropertyGroup>

  <MakeDir Directories="$(TargetDir)" />
  <Copy SourceFiles="$(OutputPath)$(AssemblyName).dll" DestinationFolder="$(TargetDir)" OverwriteReadOnlyFiles="true" />
  
  <Message Importance="high" Text="Copied $(AssemblyName).dll to $(TargetDir)" />
</Target>

Note the TargetDir value and adjust it according to your local environment.

Delete the MyPuckMod.dll from the Plugins/MyPuckMod folder and build the project again. The MyPuckMod.dll should automatically populate the Plugins/MyPuckMod directory. In addition to that, the copy process will retry automatically in case the existing MyPuckMod.dll is in use, which happens when the game client is left running.

PreviousTesting your modNextSteamWorkshopUploader

Last updated 8 days ago