Developing .NET Standard Libraries

The Synergy “Class Library (.NET Standard)” project template enables you to create class libraries that can be used for multiple platforms. Synergy .NET Standard libraries can run with .NET Framework (on Windows) and .NET 6 and higher (on Windows or Linux).

Note

Projects created from the Synergy “Class Library (.NET Standard)” template automatically include the Synergex.SynergyDE.synrnt and Synergex.SynergyDE.Build NuGet packages, which are required. When a Synergy .NET Standard project is created, the latest packages (that are not pre-release) are downloaded to a local NuGet repository for the project. To update NuGet packages for existing projects, you must use the NuGet Package Manager. See Microsoft documentation for more information (e.g., learn.microsoft.com/en-us/nuget/consume-packages/install-use-packages-visual-studio).

The following steps outline the basic procedure for using Visual Studio to create a .NET Standard class library. Most of these steps outline Visual Studio procedures, so see Visual Studio documentation for more information. (For information on using the .NET CLI to create and build a project, see Developing for .NET 6 or Higher.)

1. Start by reviewing Synergy .NET Requirements and the SDI requirements page (www.synergex.com/synergy-dbl-integration). Then set options for your Visual Studio environment as necessary. For example, you can control the behavior of the Visual Studio code editor (indentation, tab size, etc.), the way IntelliSense works for Synergy DBL files, and which file types are automatically treated as compile or content files. See Options for Synergy/DE projects for more information.
2. In Visual Studio, open the solution for the application you want to add the library to, and then select File > New > Project from the Visual Studio menu.
3. In the New Project window, select the “Class Library (.NET Standard)” template. (You can use the New Project dialog’s search field to find this.) Set options as necessary (e.g., specify the name of the project), and then click OK.

The project is added to the solution that is currently open, and you can see a branch for the project in Solution Explorer. (Select View > Solution Explorer to open Solution Explorer.) For more information on projects and solutions, see Projects for Synergy .NET.

4. Add DBL code, resources, and other items to the .NET Standard library project, and make sure it references any needed assemblies. See Synergy/DE item templates for information on new items you can add to a project, and note the following:
5. Set project properties, which include settings for deployment and building/compiling. See Synergy/DE project properties. For information on setting environment variables for a project, see Environment variables and Visual Studio development.
6. Build and debug the solution using Visual Studio build and debug commands. See Visual Studio documentation for information on build features and the debugger. See Debugging Synergy .NET Code for debugging information specific to Synergy .NET. And see the Project Only information in SDI features for information on commands that enable you to build or rebuild (or clean) an individual project without affecting other projects in the solution, even referenced projects.
7. Deploy to machines that meet deployment requirements listed in Synergy .NET Requirements.