Debugging

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

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.

Creating a Plugin
  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.

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.

Last updated