Developing for .NET Framework
The following are the basic Synergy .NET development steps for desktop and server applications for .NET Framework on Windows x86 or x64. Most of these steps outline Visual Studio procedures, so see Visual Studio documentation for more information.
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, create a project for each assembly in your application, and put all the projects for your application in one solution. You can use the following project templates for .NET Framework development: |
ASP.NET Server Control Library
Class Library (.NET Framework)
Unit Test Project (.NET Framework)
For example, to create a console application (an application that runs from the command line), select File > New > Project in Visual Studio. Then select the "Console App (.NET Framework)" template. (You can use the New Project dialog's search field to find this.) See Synergy projects, solutions, and files for more information, and note the following:
- If no solution is open in the current instance of Visual Studio, creating a project will also create a solution to contain the project. To add the project to an existing solution, open the solution in Visual Studio before you create the project. To start with a blank solution, do the following before you create projects for the application: select File > New > Project from the Visual Studio menu, and then select the Blank Solution template. You can use the search feature in the New Project dialog to find this template.
- You can include Synergy projects in a solution for another .NET language (e.g., in a C# solution), and a solution with Synergy projects can include projects written in other .NET languages. See Visual Studio Projects for Synergy .NET for more information.
- For portability, put logic in .NET Standard libraries. A Synergy .NET Standard library can target the .NET Framework and .NET Core on Windows. For more information, see Developing .NET Standard libraries.
3. | Add DBL code, references to any needed assemblies, and other items to the projects for your application. See Synergy/DE item templates for information on new items you can add to a project, and note the following: |
- For information on which Synergy features are supported for Synergy .NET, see Synergy DBL Support for .NET.
- For information on adding references or dependencies to Synergy repositories, see Using Synergy/DE repositories in Visual Studio.
- See Performing Common Synergy .NET Coding Tasks for information on instantiating and using a .NET class, inheriting and overriding a .NET class, and more.
- Synergy projects for Windows desktop and server applications automatically reference synrnt. This is required. See Synergy runtime and build libraries for more information.
- Device licensing is optional with .NET Framework. To use device licensing, an assembly in your application must implement device licensing, and that assembly must be built with the “Enable device licensing” option on the Compile page of project properties. See Device Licensing.
- To use the Repository subroutine library, you must add a reference to Synergex.SynergyDE.ddlib.dll. To use the XML API, you must add a reference to Synergex.SynergyDE.synxml.dll.
- For Interop projects, Synergy global structures used as attribute arguments must be defined in an assembly outside of a namespace.
- You are not limited to the standard file extensions for Synergy DBL files (e.g., .dbl for code files). You can add files with other extensions if you specify those extensions in the Visual Studio IntelliSense dialog box for the Synergy DBL text editor. See IntelliSense page of Visual Studio text editor options.
- Use ASYNC routines for communication across networks and the internet. See Asynchronous processing (.NET).
- 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.
4. | Set project properties, which include settings for licensing, 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. For information on setting project properties for ClickOnce Deployment, see ClickOnce Deployment for Synergy .NET below. |
5. | Build and debug the solution in Visual Studio 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. |
6. | Deploy your application to machines that meet deployment requirements listed in Synergy .NET Requirements. |
ClickOnce Deployment for Synergy .NET
Use ClickOnce only for very simple deployments for Synergy .NET Windows desktop applications. ClickOnce deployment is not supported for traditional Synergy or Synergy .NET Core applications. |
ClickOnce is a Microsoft deployment technology that enables you to deploy self-updating, self-contained Windows desktop applications that don’t require administrative access to user systems. Setting up ClickOnce deployment can be as easy as setting properties on the Publish page of project properties and then clicking a publish button, but you may need to do more. For example, you may need to specify a Synergy license server.
Synergy .NET supports ClickOnce deployment through the following:
- The Publish page of project properties. Use this to set basic options for ClickOnce deployment. We do not recommend specifying a Web site as the publishing folder location because this requires FrontPage Server Extensions, which Microsoft no longer supports. Instead, specify an FTP server.
- The Runtime Settings page of project properties and the <SynergyLicenseServer.../> tag and <add key...value.../> pairs for the <SynergyEnvironment> tags in App.config. These set the Synergy license server and environment variables used at runtime on Windows systems. You will need to set a Synergy license server if your application will be deployed to a system that does not have Synergy licensing configured.
- The "Icon and manifest", "Manifest", and "Resource file" options on the Application page of project properties. Use these to control manifest creation for the project.
See Microsoft documentation for more information on ClickOnce deployment.
All ClickOnce deployments of Synergy applications should be to systems with Synergy/DE. The development system and target systems must have the same version of synrnt.dll and the same hotfixes, if any have been applied. Processor-independent application assemblies are not supported. Synergy applications deployed with ClickOnce must be built for either x86 or x64. Although it is not supported, you may be able to deploy to a system that does not have Synergy/DE if your application doesn’t use HTTPS (with the Synergy HTTP document transport API), SQL Connection, or encryption (including xfServer). If you attempt this, note the following:
|