Skip to content

Tutorial 04 03 Add Traditional Bridge Library Code

Steve Ives edited this page May 20, 2020 · 21 revisions

Harmony Core Logo

Tutorial 4: Add Traditional Bridge Library Code

Having added a Traditional Bridge project to your Harmony Core solution, the next step is to add the Traditional Bridge library code to the new project. This library code is a collection of pre-written helper code that is provided by Harmony Core to help you deal with JSON data, receive, parse, construct and send JSON-RPC messages, and more.

As you work through this tutorial you will be adding various types of code into the TraditionalBridge project, so it's a good idea to use folders to segregate the different types of code.

  1. In Solution Explorer, right-click on the TraditionalBridge project, select New Folder, and name the folder Bridge.

We're going to use the Harmony Core Upgrade Tool to provide the Traditional Bridge library code into our new project, but we need to give it a hint where we want it to put the code by creating a source file that it is coded to look for.

  1. Right-click on the new Bridge folder, select Add > Class..., name the class RoutineDispatcher.dbl, and click the Add button to add the new file.

Now you can use the project upgrade tool, which will do three things:

  • Check all of your projects and make sure that you are using the latest released version of Harmony Core, and appropriate versions of all dependencies.
  • Provide updated versions of all CodeGen templates.
  • Add the Traditional Bridge library code into your new Bridge folder.
  1. Use Tools > Command Prompt (x64) to open a command prompt window.

  2. Move up one level to your main solution directory.

    cd ..
    
  3. In Visual Studio, close the solution.

  4. Execute the following command to run the update tool:

    harmonycore upgrade-latest
    

    You will be required to enter YES to confirm the upgrade, and you should see output similar to this:

    Scanning 'D:\HC_WEBINAR_MyDemoApi' for HarmonyCore project files
    This utility will make significant changes to projects and other source files in your Harmony Core development 
    environment. Before running this tool we recommend checking the current state of your development environment into your 
    source code repository, taking a backup copy of the environment if you don't use source code control.
    
    Type YES to proceed:
    YES
    Updating template files in D:\HC_WEBINAR_MyDemoApi\Templates
    Found template files in D:\HC_WEBINAR_MyDemoApi\Templates\SignalR
    Found template files in D:\HC_WEBINAR_MyDemoApi\Templates\TraditionalBridge
    Updating traditional bridge files in D:\HC_WEBINAR_MyDemoApi\TraditionalBridge\Bridge
    

If your solution was using an earlier version of Harmony Core then it will have been updated to the latest version, and the upgrade tool should have provided the latest version of the Traditional Bridge library code into your new Bridge folder.

  1. In Visual Studio, re-open the solution.

  2. In Solution Explorer, right-click on the Bridge folder and select Add > Existing Item...

  3. Drill into the Bridge folder and select all of the DBL files, then click Add to add the files to the project.

  4. Right-click on the TraditionalBridge project and select Build.

  5. Check the Output window and verify that the build was successful.

    1>------ Build started: Project: TraditionalBridge, Configuration: Debug x64 ------
    ========== Build: 1 succeeded, 0 failed, 0 up-to-date, 0 skipped ==========
    

Next topic: Add Traditional Bridge Routines


Clone this wiki locally