HogWarp
  • Home
    • Frequently Asked Questions
    • Supported Versions
  • Client
    • Quick start
      • Playstation Controller not working
      • Epic Games Version Saves Fix
  • Server
    • Quick Start
    • Server Requirements
    • Troubleshooting
  • Scripting
    • Getting Started
    • Client side
      • Basics
      • Setting up mods
        • Local Cooking / Building
    • Server side
      • Plugin
        • Creating a Plugin
        • Structure / Lifecycle
        • Plugin ↔ Plugin
      • Debugging
      • Event handling
      • API Documentation
        • Server
          • IPlugin
          • PlayerSystem
          • RpcManager
          • Timer
          • World
        • Game
          • Types
        • Systems
          • Logger
          • ClientRpcAttribute
          • ReplicatedAttribute
          • ServerRpcAttribute
Powered by GitBook
On this page
  • Configure the Debugger
  • Start Debugging the Server
  1. Scripting
  2. Server side

Debugging

How to set up the debugger in Visual Studio or JetBrains Rider.

PreviousPlugin ↔ PluginNextEvent handling

Last updated 3 months ago

While developing, you may encounter bugs that are not easily understandable by simply logging variables to the console. In such cases, a debugger can be incredibly useful. It allows you to inspect values in real time, helping you better understand what is happening and identify the root cause of the issue.

Configure the Debugger

We assume that you have already set up your server-side plugin. If not, please create one first.

  1. Open your project in Visual Studio.

  2. Navigate to the Debug tab at the top of the IDE.

  3. In the context menu, scroll down and click on Debug Properties at the bottom.

  1. This will open the Launch Profiles window.

  2. Click on Create a new profile at the top left.

  3. Then, select Executable from the options.

This will create your new profile. In our example, we renamed it to Debug Server. You can find the rename option above the profile, located at the far right.

  1. Now, select the Executable and click on Browse.

  2. After clicking, a dialog will open.

  3. Navigate to and select Server.Loader.exe, then click Open at the bottom right.

The dialog will close. Now, you need to define the Working Directory. To do this, click on Browse.... This will open another dialog.

Here, you need to select the folder containing your Hogwarp server files, where the Server.Loader.exe is located.

Click OK to close the dialog. Now, you can close the Launch Profiles dialog as well.

  • Open your project in JetBrains Rider.

  • Navigate to Add Configuration... at the top right of the IDE.

  • Click on it, and then select Edit Configurations... .

The Run/Debug Configurations window will open. Click on the + (plus) icon at the top left and create a .Net Executable .

Now, you should have a new configuration. In our case, we will rename it to Debug Server. To do this, click next to the Name property and enter the new name.

Now, we need to configure the Exe path. To do this, click on the folder icon in the blank line to the right.

After clicking, a dialog will open. Navigate to and select Server.Loader.exe, then click Open at the bottom right.

The dialog will close. Now, click OK to close the Run/Debug Configurations dialog.

Start Debugging the Server

After configuring the debugger, you can now start your server within the IDE and begin debugging it.

To effectively debug your server, we recommend changing your configuration to use Debug mode instead of Release mode.

After making this change, ensure that your created profile is selected if it isn’t already.

Now, click on your profile—in our case, Debug Server—and the server should start with debugging enabled. As an example, we added a breakpoint at line 10 to demonstrate how it looks when it’s working.

To effectively debug your server, we recommend changing your configuration to use Debug mode instead of Release mode.

After making this change, ensure that your created profile is selected if it isn’t already.

Now, click on the bug icon (debug icon), and the server should start with debugging enabled.

As an example, we added a breakpoint at line 10 to demonstrate how it looks when debugging is active.

Creating a Plugin