Getting Started in Visual Studio
  • 30 Jul 2024
  • 2 Minutes to read
  • Dark
    Light

Getting Started in Visual Studio

  • Dark
    Light

Article summary

Overview

To better grasp the SDK documentation, developers should be acquainted with Visual Studio or another integrated development environment (IDE). In the Decisions documentation Visual Studio 2019 will be utilized. This document will explain how to create a project in Visual Studio, how to add Decisions specific references, and how to insert a .dll into Decisions. Adding custom content via the SDK requires building Class Libraries in .NET Core.

.NET Core 3.1 (Versions 7.0 - 7.1) or .NET 5 (Version 7.2+) Architecture Changes
All custom steps will now need to be written in .NET Core 3.1 (Versions 7.0 - 7.1) or .NET 5 (Version 7.2+). The DecisionsFramework.dll will still be used in Decisions 7 for writing custom steps.

Creating a Project

  1. In the Visual Studio start-up dialog, click Create a new project. Enter "class library" in the search box and select Class Library (.NET Framework). Click Next. Configure the Project name, Location, and Framework and click Create. 
  2. To use the DecisionsFramework, a reference to DecisionsFramework.dll must be added. Navigate to the Solution Explorer. Right-click References and select Add Reference. Within the Reference Manager, browse for DecisionsFramework.dll by navigating to Decisions\Decisions Services Manager\bin. Click Add and then click OK
    If the Solution Explorer is not readily available, navigate to View > Solution Explorer.


    Now that the DecisionsFramework reference is attached to this project, many DecisionsFramework namespaces are available to reference. For examples that include code, please refer to the other SDK documentation, starting with Simple Flow Steps.



Add .dll to Decisions

 Once a developer has finished the code, a Dynamic Link Library (.dll) must be built.  This .dll will contain coded instructions other programs can call upon to perform intended actions.

For the custom DLL functionality to take place without the service restart, the Allow Dynamic Resources Loading (Local module) feature must be enabled on the installer when Decisions is installed.

Manual Upload

  1. Select Build > Build Solution. Once the build is complete, Visual Studio saves the .dll by default in C:\Users\[User]\source\repos\[Project Name]\[Project Name]\bin\Debug\.

  2. Copy the .dll to C:\Program Files\Decisions\Decisions Services Manager\modules\Decisions.Local\CoreServicesDlls. The .dll will then be available in Decisions without needing to restart Service Host Manager.



Automatic Upload


A post-build event in Visual Studio will automatically update and save the build in the file location given. 


  1. To create a post-build event, right-click the Project Name in the Solution Explorer and select Properties.
  2. In the left panel, select Build Events. In the Post-build event command line text box, type the file path (with quotation marks) where Decisions .dll's are copied: "C:\Program Files\Decisions\Decisions Services Manager\modules\Decisions.Local\CoreServicesDlls". For the Run the post-build event drop-down, leave On successful build selected. Select the save icon in the action panel. When successful builds happen, the file will save at the proper location and will automatically be available in Decisions.



Deleting and Updating a .dll


Please refer to the Resetting Local Modules To Remove Or Update Custom DLL documentation to learn how to properly delete and update a .dll.



Troubleshooting


A .dll, built on one machine but sent to another, will likely be blocked when received.  To unblock, download the .dll, right-click the file, select Properties, then click Unblock.






Was this article helpful?