Synergy/DE project templates
This topic includes the following sections:
- Traditional Synergy project templates
- Synergy .NET project templates
- Creating a project for multiple mainline programs that use different source files with the same name
Synergy DBL Integration for Visual Studio includes project templates for
- traditional Synergy OLBs, ELBs, DBRs, and UI Toolkit window libraries. See Traditional Synergy project templates below.
- Synergy .NET assemblies (programs, libraries, and apps). See Synergy .NET project templates below.
- Synergy repositories, which can be used with traditional Synergy and Synergy .NET applications. See the entries for Synergy/DE Repository below.
In Visual Studio, Synergy project templates are available in the New Project dialog, which opens when you select a Visual Studio option that creates a new project (e.g., File > New > Project).
Synergy project templates are also available in a NuGet package, Synergex.Projects.Templates, which can be used with the .NET CLI to develop Synergy applications. You can install these templates by running the following command:
dotnet new install Synergex.Projects.Templates
If you get an error (e.g., “Synergex.Projects.Templates could not be installed, the package does not exist”), the problem could be that the NuGet feed (https://api.nuget.org/v3/index.json) is not set up as a package source on your system. See Microsoft documentation on package sources for information on adding this package source. |
You can then use the .NET CLI command “dotnet new shortname” (where shortname is one of the names listed as a “NuGet package short name” below) to create a project based on one of these templates. For example, the following creates a Synergy project (called MySynNetApp) for a console application that runs on .NET 6 or higher:
dotnet new SynNETApp -n MySynNetApp
For information on using the .NET CLI, see Microsoft documentation and the “Basic .NET CLI development steps” sections in Developing for .NET 6 or Higher, Developing for .NET Framework, and Developing a traditional Synergy application in Visual Studio.
Traditional Synergy project templates
For information on using these templates to develop traditional Synergy applications and libraries, see Developing a traditional Synergy application in Visual Studio.
NuGet package short name: synELB
For creating a traditional Synergy executable library (ELB), which is a collection of traditional Synergy routines that can be used in traditional Synergy OLBs, DBRs, and other ELBs. Note the following:
- You can build an ELB directly from an OLB. To do this, open the ELB project and add a reference to the OLB project. Then remove any source files from the ELB project, and build the ELB.
- To include gennet40/gennet-generated source files in an ELB, add the source files as compile files, add the .inc file generated by gennet40/gennet as a content file, and set the “Concatenate source files (-qconcat)” option on the Compile page of project properties before compiling the project.
- For OpenVMS development, use this template for code that will become a shared library. See OpenVMS development with Visual Studio.
Projects created with this template can reference traditional Synergy ELB, OLB, and Repository projects.
See the Synergex YouTube video Using the ELB Project Template. |
NuGet package short name: synMultiMain
For creating a traditional Synergy project that results in multiple traditional Synergy mainline programs. Use this to create an application that is distributed as a number of DBRs (which are typically linked against common libraries). Note that each source file results in a separate .dbr file, and each source file can be run and debugged separately. To do this, right-click the source file in Solution Explorer and then select “Start Debugging” or “Start Without Debugging” from the context menu.
To specify which program in a multiple mainline project is the entry point for the application, set the “Startup object” option on the Application page of project properties, or right-click the source file in Solution Explorer and select “Set as Startup object” from the context menu. (The program set as the startup object is displayed in bold text in Solution Explorer.) For more information, see Application page of Visual Studio project properties (traditional Synergy).
For information on associating source files with mainline files, see Creating a project for multiple mainline programs that use different source files with the same name below.
Projects created with this template can reference traditional Synergy ELB, OLB, and Repository projects.
See the Synergex YouTube video Using the Multiple Mainline Project Template. |
NuGet package short name: synOLB
For creating a traditional Synergy object library (OLB) that can be linked to or referenced by other libraries and applications. Note the following:
- To build only sources that have been added or changed since the last build, select a Build option from the Visual Studio Build menu. To rebuild the entire project or solution, select a Rebuild option from the Visual Studio Build menu. You will need to do this if you remove a source module and you want the build to reflect that change.
- An OLB project should be referenced by only one project in the solution. (Referencing an OLB project from multiple projects causes the OLB code to be compiled into multiple files for the application.) When creating a library for shared code, use an ELB rather than an OLB.
- To include gennet40/gennet-generated source files in an OLB, add the source files as compile files, add the .inc file generated by gennet40/gennet as a content file, and set the “Concatenate source files (-qconcat)” option on the Compile page of project properties before compiling the project.
Projects created with this template can reference source files and Repository projects.
For information on building an ELB directly from an OLB, see Executable Library (ELB) above.
See the Synergex YouTube video Using the OLB Project Template. |
NuGet package short name: synScriptProj
For creating a UI Toolkit window library. Script projects accept window script source files and compile those sources to produce the result. May reference Repository projects to automatically supply RPSMFIL and RPSTFIL to the Script compiler.
NuGet package short name: synRepoProj
For creating a repository that can be referenced by traditional Synergy and Synergy .NET projects. Repository projects replace RPSMFIL and RPSTFIL settings and enable the build system to know when a project should be rebuilt due to a repository change. See Using Synergy/DE repositories in Visual Studio and Repository page of Visual Studio project properties for more information.
See the Synergex YouTube video Using the Repository Project Template. |
NuGet package short name: synTradApp
For creating a traditional Synergy program with a single .dbr file. (Only one source file will contain a MAIN.) Projects created with this template can reference traditional Synergy ELB, OLB, and Repository projects.
NuGet package short name: synTradUnitTestProj
For creating an MSTest unit test project for traditional Synergy unit tests. When built, a traditional Synergy unit test project results in a traditional Synergy unit test library, which is an ELB. See Unit testing for traditional Synergy for more information.
Synergy .NET project templates
For information on using the following templates to develop Synergy .NET applications and libraries, see Developing for .NET Framework, Developing for .NET 6 or Higher, and Developing .NET Standard Libraries. Note that project templates for .NET 6 and higher and .NET Standard are referred to as SDK-style project templates.
ASP.NET Server Control Library
NuGet package short name: synWebControlLib
For creating a library assembly (.dll) that contains ASP.NET web server controls—i.e., controls that extend System.Web.UI.WebControls.
NuGet package short name: synNETLib
For creating a library assembly that targets .NET 6 or higher. See Developing for .NET 6 or Higher for more information.
Class Library (.NET Framework)
NuGet package short name: synNETFrameworkLib
For creating a library assembly (.dll) that targets .NET Framework on Windows.
NuGet package short name: synNETStandardLib
For creating a library assembly (.dll) that targets .NET Standard. See Developing .NET Standard Libraries for more information.
NuGet package short name: synNETApp
For creating a console application that runs on .NET 6 or higher. See Developing for .NET 6 or Higher for more information.
NuGet package short name: synNETFrameworkApp
For creating a command-line application (.exe) that targets .NET Framework on Windows.
NuGet package short name: synEmptyProj
For creating a project with no source files or references. By default, projects created from this template generate application assemblies (.exe).
NuGet package short name: synInterop
For accessing Synergy routines from a .NET assembly created with another language. This template was designed for converting xfServerPlus routines for native .NET access, but it can be used in other cases. See the following for more information.
- See Preparing Existing Code for Synergy .NET for information on converting xfServerPlus routines for native .NET access.
- See Performing Common Synergy .NET Coding Tasks for information on calling a routine in a Synergy assembly from another .NET assembly.
For information on project properties specific to Interop projects, see Interop page of Visual Studio project properties (Synergy .NET).
NuGet package short name: synNetMutiMainine
For creating a Synergy .NET 6 or higher project that consists of multiple Synergy mainline programs that share project settings and references. A project created with this template results in an application that is distributed as a number of EXEs. Each mainline source file results in a separate executable file that can be run and debugged separately by right-clicking the source file in Solution Explorer and selecting “Start Debugging” or “Start Without Debugging” from the context menu.
To specify which program in a multiple mainline project is the entry point for the application, set the “Startup object” option on the Application page of project properties, or right-click the source file in Solution Explorer and select “Set as Startup object” from the context menu. (The program set as the startup object is displayed in bold text in Solution Explorer.) For more information, see Application page of Visual Studio project properties (Synergy .NET).
For information on associating source files with mainline files, see Creating a project for multiple mainline programs that use different source files with the same name below.
Multiple Mainline (.NET Framework)
NuGet package short name: synNETFrameworkMultiMain
For creating a .NET Framework Synergy project that consists of multiple Synergy mainline programs that share project settings and references. A project created with this template results in an application that is distributed as a number of EXEs. Each mainline source file results in a separate executable file that can be run and debugged separately by right-clicking the source file in Solution Explorer and selecting “Start Debugging” or “Start Without Debugging” from the context menu.
To specify which program in a multiple mainline project is the entry point for the application, set the “Startup object” option on the Application page of project properties, or right-click the source file in Solution Explorer and select “Set as Startup object” from the context menu. (The program set as the startup object is displayed in bold text in Solution Explorer.) For more information, see Application page of Visual Studio project properties (Synergy .NET).
For information on associating source files with mainline files, see Creating a project for multiple mainline programs that use different source files with the same name below.
NuGet package short name: synCustomAction
For creating an MSI custom action when using the Windows Installer XML (WiX) toolset. Use this when you need to invoke Synergy-specific functionality in a WiX installer—e.g., if you want to create or modify an ISAM file as part of a WiX install.
NuGet package short name: synRepoProj
For creating a repository that can be referenced by traditional Synergy and Synergy .NET projects. Repository projects replace RPSMFIL and RPSTFIL settings and enable the build system to know when a project should be rebuilt due to a repository change. See Using Synergy/DE repositories in Visual Studio and Repository page of Visual Studio project properties for more information.
See the Synergex YouTube video Using the Repository Project Template. |
NuGet package short name: synNETUnitTest
For creating a project that contains .NET 6 or higher unit tests. See Unit Testing for .NET.
Unit Test Project (.NET Framework)
NuGet package short name: synUnitTestProj
For creating a project that contains unit tests.
NuGet package short name: synWCFServiceLib
For creating a library assembly (.dll) with Windows Communication Foundation (WCF) services.
NuGet package short name: synWinFormsApp
This project type is deprecated. Synergy Windows Forms projects are no longer supported.
For creating an application with a Windows Forms user interface.
NuGet package short name: synWinFormsCtrlLib
This project type is deprecated. Synergy Windows Forms projects are no longer supported.
For creating a library assembly (.dll) with controls to use in Windows Forms applications.
NuGet package short name: synWinService
For creating a Windows service (.exe).
NuGet package short name: synWPFApp
This project type is deprecated. Synergy WPF projects are no longer supported.
For creating a Windows Presentation Foundation (WPF) application.
NuGet package short name: synWPFCtrlLib
This project type is deprecated. Synergy WPF projects are no longer supported.
For creating a library assembly (.dll) with user-defined Windows Presentation Foundation (WPF) controls (i.e., controls that extend System.Windows.Forms.UserControl).
Creating a project for multiple mainline programs that use different source files with the same name
If you have a Synergy application with both of the following:
- A number of mainline programs that reference source files (instead of ELBs or OLBs) and are built with these source files
- Referenced source files that share the same name but have different code—e.g., different implementations of a subroutine for different mainlines.
then the SDI functionality described below is designed to enable you to develop a multiple mainline project for that application in Visual Studio. (As an alternative, you may be able to create a project for each mainline, but this is generally less convenient than a multiple mainline project, and if there are too many projects, Visual Studio might not be able to load the solution.)
The following XML attribute and tags enable a multiple mainline project to support this type of application. All three are required in the .synproj file for the project and are illustrated in the example code below.
- DependencyFiles – This attribute for the Compile tag accepts a semicolon-delimited list of source files to associate with the mainline program that the Compile tag is for. Add this attribute to the Compile tag for each mainline that uses other source files.
- Link – In each Compile tag, add a Link tag to specify the name of the mainline as it will appear in Solution Explorer.
- None Include – For each file in each DependencyFiles list for the project, add a “None Include” tag to the .synproj file (e.g., at the end of the .synproj file).
For example, if you have a project with two mainlines that each reference two different source files but with the same names (e.g. ABC.DBL and XYZ.DBL), the .synproj file would need to include something like the following:
...
<Compile Include="..\..\SRC1\MAIN1.DBL" DependencyFiles="..\..\SRC1\ABC.DBL; ..\..\SRC1\XYZ.DBL">
<Link>MAIN1.DBL</Link>
</Compile>
<Compile Include="..\..\SRC2\MAIN2.DBL" DependencyFiles="..\..\SRC2\ABC.DBL; ..\..\SRC2\XYZ.DBL">
<Link>MAIN2.DBL</Link>
</Compile>
...
<None Include = "..\..\SRC1\ABC.DBL" />
<None Include = "..\..\SRC1\XYZ.DBL" />
<None Include = "..\..\SRC2\ABC.DBL" />
<None Include = "..\..\SRC2\XYZ.DBL" />
In Solution Explorer, ABC.DBL and XYZ.DBL would appear as subnodes under MAIN1.DBL, and MAIN2.DBL, but they would be for different source files from different directories.