Onsharp
  • What is Onsharp?
  • Changelog
  • Onsharp Environment
    • Onsharp Runtime Environment
    • Installation
    • Configuration
  • Basic Usage
    • Preparation
    • Create a Basic Plugin
    • Concept of Entry Points
    • Create Commands
    • The EventAPI of Onsharp
    • Configs and DataStorage
    • Logging
    • Debugging
  • Advance Usage
    • Auto Updater
    • Overriding Entity Factories
    • Interop of LUA and vice versa
    • Entity Pool Refreshing
    • Create Console Commands
    • Providing LUA packages
  • Modules
    • Lazy Mover
    • I18n
Powered by GitBook
On this page
  • Prerequisites
  • Setup Debugging

Was this helpful?

  1. Basic Usage

Debugging

On this page we explain how to setup debugging in Visual Studio so you can debug your plugins while running an Onset server.

Prerequisites

We assume that you already have a running Onset server, Onsharp installed and a theoretically working plugin project.

Setup Debugging

  1. First of all, activate dependency export for your project, if you does not have it currently:

    1. Therefore right click your project and Edit Projectfile (.csproj)

    2. Search the line with the TargetFramework

    3. Put the following line below the TargetFramework line:

      <CopyLocalLockFileAssemblies>true</CopyLocalLockFileAssemblies>

  2. Go to the properties page of your project (Right-Click on Project -> Properties)

  3. Head over to the Debugging page

  4. Change the Launch dropdown to Executable

  5. Select the OnsetServer.exe of your Onset server in your server directory via the Browse button close to the textbox and the Executable label

  6. Select your server directory under Working Directory

  7. Now head over to the Build Events page and put the following commands into the text area for post-build event (Post-build event command line): view below

    Replace YOUR_SERVER_DIRECTORY with the path to your server directory. Keep in mind to change every slash (/) in the path to a backslash (\)

  8. Now your debugging can begin!

The commands for the post-build event command line:

copy /Y "$(TargetPath)" "E:\Development\Onset\_test-server\onsharp\plugins\$(TargetFileName)"

del /Q "$(TargetPath)"

del /Q "$(OutDir)\$(TargetName).deps.json"

del /Q "$(OutDir)\$(TargetName).pdb"

del /Q "$(OutDir)\Onsharp.dll"

del /Q "$(OutDir)\DotNetZip.dll"

del /Q "$(OutDir)\Goblinfactory.Konsole.dll"

del /Q "$(OutDir)\Nett.dll"

del /Q "$(OutDir)\Newtonsoft.Json.dll"

del /Q "$(OutDir)\Serilog.dll"

del /Q "$(OutDir)\Serilog.Sinks.Console.dll"

del /Q "$(OutDir)\System.Security.Permissions.dll"

xcopy /Y "$(OutDir)" "YOUR_SERVER_DIRECTORY\onsharp\libs"

PreviousLoggingNextAuto Updater

Last updated 4 years ago

Was this helpful?