NuGet Packages and More, for Remoting SDK and Data Abstract

The next build of Remoting SDK and Data Abstract  will bring several quite important features.

Some of them are relatively small ones, like support for Async Service Methods in Code-First Servers on .NET; others are a quite important and long awaited step forward.

Let me introduce NuGet packages for Remoting SDK and Data Abstract:

These NuGet packages can target .NET 3.5 and above, .NET Core 2.1 and above, .NET Standard 2.0 and of course .NET 5. Packages are available via separate package source named 'RemObjects Software'

Limitations

There are some limitations one should be aware of:

  • Packages are deployed into local offline storage. We do not upload these packages to NuGet.org, at least not as of yet.
  • These packages contain only reference assemblies. They do include neither any tools like Schema Modeler or Service Builder, nor Visual Studio integration.
  • The most important limitation is that the packages do not contain any license management code. In other words, a full installation of Remoting SDK / Data Abstract is still requiered to build and develop applications.

The last two points mean that some additional actions are required to allow RemObjects packages to be used on build machines. There is no need to create license carrier package described below, if only local builds are used.

For now there are 3 possible options to manage .licx licenses (i.e. license compilation) on build machines:

  1. To install the full version of Remoting SDK / Data Abstract. Obviously this might not always be feasible or possible.
  2. To put a set of assemblies required to perform license compilation into the GAC.
  3. To create a license carrier package. Luckily most build machine solutions support private package feeds. This approach allows to provide pre-built licenses that can be used by the application built using build machine.

How to Create a License Carrier Package

Create a new .NET Standard 2.0 Class Library project, in Visual C# or Visual Basic.NET, named for example LicenseCarrier, and add a LicenseManager class to this project:

public static class LicenseManager
{
	public static void Init()
	{
	}
}

The purpose of this class is to provide a way to ensure that licenses are actually loaded into the application (see more detailed explanation below).

Then reference packages that contain licensed components:

  • For Remoting SDK server applications add reference the the RemObejcts.SDK.Server package
  • For Data Abstract client applications add reference to the RemObjects.DataAbstract package
  • For Data Abstract server applications add reference to the RemObjects.DataAbstract.Server package

Note: Versions of packages referenced by the license carrier project should exactly match the ones that will be used later by the actual application.

Add licesnes.licx file as an embedded resource.

For Remoting SDK server application the licesnes.licx file should contain the following entry:

RemObjects.SDK.Server.IpHttpServerChannel, RemObjects.SDK.Server

For Data Abstract server application the licesnes.licx file should additionally contain the following entries:

RemObjects.DataAbstract.Server.ConnectionManager, RemObjects.DataAbstract.Server
RemObjects.DataAbstract.LocalDataAdapter, RemObjects.DataAbstract.Server

At the same time for Data Abstract client application it is enough to provide only these lines:

RemObjects.DataAbstract.RemoteDataAdapter, RemObjects.DataAbstract
RemObjects.DataAbstract.Linq.LinqRemoteDataAdapter, RemObjects.DataAbstract

After adding the licenses.licx file content, open the project properties, enable the "Generate NuGet package on build" option, and build the solution.

The License Carrier package will be built and saved in the file [path to the project]\LicenseCarrier\bin\Release\LicenseCarrier.1.0.0.nupkg

To add the LicenseCarrier to the NuGet package feed, copy this file into the folder [RemObjects installation path]\RemObjects Software\Packages and restart Visual Studio.

This operation will add the License Carrier package into the 'RemObjects Software' packages source.

How to use the License Carrier Package

To use the License Carrier package just reference it using NuGet and add this method call into the application startup code:

LicenseManager.Init();

This method call does one essential thing: it ensures that the license carrier assembly is loaded by the application before any license checks are performed.

Now the LicenseCarrier package can be put into a private NuGet packages feed and then used on a build machine, allowing applications built there to use your RemObjects licenses.