Synergy .NET Basics
This topic includes the following sections:
- Visual Studio projects and Synergy DBL: the building blocks
- Synergy .NET components
- Compile-time defines
- Using environment variables
- Using Synergy/DE repositories
- Other options for .NET
.NET applications are made up of assemblies: executable assemblies (.exe) and class library assemblies (.dll). Synergy .NET components enable you to use Visual Studio to create Synergy .NET executables and libraries for .NET Framework and .NET 6 and higher on Windows x86 and x64.
The following table lists supported platforms. For information on requirements, see Synergy .NET Requirements and www.synergex.com/synergy-dbl-integration.
Platform | Device licensinga | Project templatesb | NuGet packagesc |
---|---|---|---|
.NET Framework on Windows x86 or x64 | Optional |
ASP.NET Server Control Library Class Library (.NET Framework) Class Library (.NET Standard) Console App (.NET Framework) Empty Project Interop Synergy Custom Action Synergy/DE Repository Unit Test Project (.NET Framework) WCF Service Library Windows Service |
For .NET Standard only: Synergex.SynergyDE.synrnt and Synergex.SynergyDE.Build |
.NET 6 or higher on Windows x86 or x64 | Not supported |
Console App (.NET) Class Library (.NET) Class Library (.NET Standard) Synergy/DE Repository Unit Test (.NET) |
Synergex.SynergyDE.synrnt |
a. See Licensing .NET assemblies for information on device licensing.
b. See Synergy/DE project templates for information on project templates.
c. See Synergy .NET libraries and NuGet packages below for information.
There are a number of advantages to developing with Synergy .NET. In addition to the benefits of managed code and the Visual Studio IDE, Synergy .NET assemblies can use .NET classes, they can interoperate with assemblies written in other .NET languages (such as C# or VB), and more.
Visual Studio projects and Synergy DBL: the building blocks
Project templates are the starting points for application and library development in Visual Studio. You’ll use project templates to create Synergy projects, and you’ll build Synergy applications and libraries from those projects. See Synergy projects, solutions, and files for more information. Synergy templates are available in Visual Studio when SDI is installed, and they are also distributed in the following NuGet packages for use with the .NET CLI (i.e., the “dotnet” command): Synergex.Projects.Templates and Synergex.ProjectItem.Templates.
In code files for your Synergy projects, you’ll use Synergy DBL statements, routines, etc., that are supported for Synergy .NET. See Synergy DBL Support for .NET for information on which Synergy DBL features are supported for .NET, and note that the grid that appears at the top of each topic for a Synergy DBL routine indicates whether the routine or statement is supported for Synergy .NET. If WN is visible in the grid (as it is for XRETURN for example), the routine or statement is supported for Synergy .NET, although there may be restrictions. See Documentation conventions for more information on this grid.
Synergy .NET components
Synergy .NET is not a Synergy/DE product. Rather, it is a term for the use of Synergy DBL with .NET. The Synergy/DE components used for Synergy .NET development are Synergy DBL Integration for Visual Studio (SDI), the Synergy .NET libraries, and the Synergy .NET NuGet packages.
Synergy DBL Integration for Visual Studio
Synergy DBL Integration for Visual Studio (SDI) is a Synergy/DE product that enables you to use Visual Studio to develop Synergy applications and libraries.
SDI enables you to use Visual Studio features (such as IntelliSense, colorization, and regions) as you develop Synergy applications, and it hooks into and provides project wizards and designers. For Synergy .NET development, SDI includes the Synergy .NET compiler, which is invoked by Visual Studio build features (MSBuild). SDI also enables you to use the Visual Studio debugger to debug your Synergy .NET code for Windows applications. If a Synergy .NET assembly interoperates with code from other languages, you can step seamlessly from one language to another.
See SDI Basics for more information on SDI, and see www.synergex.com/synergy-dbl-integration for information on system requirements.
Synergy .NET libraries and NuGet packages
Although Synergy .NET assemblies run under a common language runtime (CLR) for the .NET Frameworks they target, some Synergy-specific runtime functionality is required. This is supplied by runtime libraries, which are included in Synergy/DE for desktop/server applications and libraries,
With SDK-style projects, there is another NuGet package, Synergex.SynergyDE.Build, which is used behind the scenes for project builds. A reference to this package is required and is automatically added to SDK-style projects.
And, in addition to being available in Visual Studio when SDI is installed, Synergy project templates and project item templates are distributed in the following NuGet packages for use with the .NET CLI (e.g., the “dotnet” command): Synergex.Projects.Templates and Synergex.ProjectItem.Templates.
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). |
SDI also includes the following libraries:
-
To use the XML API for traditional Synergy and .NET Framework development, add a reference to Synergex.SynergyDE.synxml.dll. For SDK-style projects, use the Synergex.SynergyDE.synxml NuGet package.
-
To use the Repository subroutine library for traditional Synergy and .NET Framework development, add a reference to Synergex.SynergyDE.ddlib.dll. For SDK-style projects, use the Synergex.SynergyDE.ddlib NuGet package.
-
To use the xfNetLink Synergy API for .NET Standard development, use the Synergex.SynergyDE.xfnetlink NuGet package.
-
To use gennet for .NET 6 and higher development, use the Synergex.SynergyDE.gennet NuGet package. For more information, see gennet/gennet40 utility.
Compile-time defines
The following compile-time defines enable you to conditionally compile code for .NET:
- _DEBUG — Enables you to conditionally include or exclude code based on whether or not a program is compiled in debug mode.
- DBLNET — Enables you to conditionally compile code for Synergy .NET.
- D_NETSTANDARD — Enables you to conditionally compile for .NET 6 and higher and .NET Standard.
- RUNTIME_TARGET — Set to the runtime compatibility setting for a program. RUNTIME_TARGET enables you to programmatically exclude runtime features that aren’t available in the version you target. (E.g., you could exclude Join functionality if the runtime version does not support it.)
For more information, see Built-in compiler definitions.
Using environment variables
Environment variables can be used for Synergy .NET development (e.g., for build-time settings) and runtime settings. See Environment variables and Visual Studio development for information.
Using Synergy/DE repositories
To use a Synergy/DE repository with a Synergy .NET project, you can either create a repository project and then reference that project, or use RPSMFIL and RPSTFIL (or RPSDAT) to specify the location of repository files. See Using Synergy/DE repositories in Visual Studio for more information.
Other options for .NET
Synergy .NET is the primary solution for Microsoft .NET Framework on Windows, but there are other Synergy/DE options for .NET development for desktop and server applications on Windows:
- The gennet/gennet40 utility and the Synergy .NET assembly API enable existing Synergy code to take advantage of .NET features on Windows while still using the traditional Synergy compiler and runtime on Windows. See gennet/gennet40 utility and Synergy .NET Assembly API for information.
- UI Toolkit .NET routines enable you to embed .NET forms, .NET controls, and Windows Presentation Foundation (WPF) elements in Toolkit applications using the traditional Synergy compiler and runtime on Windows. See .NET Routines.
- xfNetLink .NET Edition enables a .NET client to call Synergy routines residing on a remote server machine. Using the component generation tools, Visual Studio, and the .NET Framework, you can create an assembly that references Synergy routines. xfNetLink .NET is supported on Windows platforms only; however, you can create an assembly from Synergy routines that reside on UNIX or OpenVMS. See Part IV: xfNetLink .NET Edition.
- The .NET Framework Data Provider for ODBC (which is included with the .NET Framework) enables you to access Synergy data from .NET applications on Windows. See Accessing Synergy data in a .NET environment.