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 on Windows with .NET Framework or .NET Core.
|
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., NuGet Package Manager UI).
|
The following steps outline the basic procedure for creating a .NET Standard class library. Most of these steps outline Visual Studio procedures, so see Visual Studio documentation 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 Visual Studio 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: |
- For information on supported Synergy features, see Synergy DBL Support for .NET.
- For information on licensing, see Licensing .NET assemblies.
- See Performing Common Synergy .NET Coding Tasks for information on instantiating and using a .NET class, inheriting and overriding a .NET class, and more.
- For Interop projects, Synergy global structures used as attribute arguments must be defined in an assembly outside of a namespace.
- Use ASYNC routines for communication across networks and the internet. See Asynchronous processing (.NET) for more information.
- To use the Repository subroutine library, add a reference to Synergex.SynergyDE.ddlib.dll. To use the XML API, add a reference to Synergex.SynergyDE.synxml.dll. Note that these are not supported for .NET Core.
- To generate documentation from comments in code, use ;;; to identify documentation comments in your code, and select the “XML documentation file” option on the Build page of project properties.
|
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. |