Debugging

When loading, the SyrveFront application searches for plugins and starts a process container Resto.Front.Api.Host.exe for each of them, within which the plugin will operate. For debugging convenience, it is possible to run this process directly from the development environment. To do this, in the debugging settings of the plugin project, you need to specify the host process Resto.Front.Api.Host.exe as an external program and pass the following command-line arguments:

Next, you only need to run the SyrveFront application once (without installing the plugin in the Plugins folder), and you will be able to repeatedly start and stop the plugin directly from the development environment (F5 / Shift+F5 in Visual Studio, Alt-F5 in Rider), without restarting SyrveFront. The debugger will connect automatically, so breakpoints will work, and debugging will be interrupted when exceptions occur (in Visual Studio/Rider, you can configure which types of exceptions should or should not interrupt debugging). Log entries (PluginContext.Log) will be duplicated in the console window if it is not hidden by the --nowindow key, and in the Output window (Ctrl+Alt+O) if the debugger is connected.

To debug the plugin in this way, a plugin developer license is required.

Visual Studio

Classic .csproj

An example of filling in the fields on the Debug tab for a project in the old format:

SDK-style .csproj

For projects in the new format, the debugging parameters have moved to a separate file launchsettings.json, which can be created/edited both manually and through the UI: in the project properties Debug → General → Open debug launch profiles UI → Create a new profile → Executable. An example of the contents of launchsettings.json:

{
  "profiles": {
    "Resto.Front.Api.SamplePlugin": {
      "commandName": "Executable",
      "executablePath": "C:\\Program Files\\Syrve\\SyrveRMS\\Front.Net\\Resto.Front.Api.Host.exe",
      "commandLineArgs": "/a=\"C:\\Projects\\Front.Api Sdk\\Resto.Front.Api.SamplePlugin\\bin\\Debug\\Resto.Front.Api.SamplePlugin.dll\" /c=Resto.Front.Api.SamplePlugin.SamplePlugin /m=21005108 /l=\"C:\\Projects\\Front.Api Sdk\\Logs\\sample-plugin.log\""
    }
  }
}

Note for .NET Standard

Currently, there is a bug in Visual Studio that prevents debugging a plugin under .NET Standard when running it through the process container Resto.Front.Api.Host.exe, which is under .NET Framework.

Possible solutions:

Rider

JetBrains Rider allows you to set your own Debug Configurations with fields Exe path and Program arguments, as well as use the Visual Studio-compatible format launchsettings.json.

Alternative Options

If you do not have a plugin developer license, you will have to install the plugin in the Plugins folder so that the SyrveFront application launches it in the standard way, and each time you change the plugin, you will need to stop and restart the application. However, you can minimize the inconvenience as follows: