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 PluginOpen your project in
Visual Studio.Navigate to the
Debugtab at the top of the IDE.In the context menu, scroll down and click on
Debug Propertiesat the bottom.

This will open the
Launch Profileswindow.Click on
Create a new profileat the top left.Then, select
Executablefrom 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.

Now, select the
Executableand click onBrowse.After clicking, a dialog will open.
Navigate to and select
Server.Loader.exe, then clickOpenat 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.

Last updated