Unable to use license key in Framework applications

Discussion of open issues, suggestions and bugs regarding LinqConnect – Devart's LINQ to SQL compatible ORM
Post Reply
Posts: 3
Joined: Mon 17 Aug 2020 19:18

Unable to use license key in Framework applications

Post by KenD3 » Mon 17 Aug 2020 19:28

We’ve just purchased a license for LinqConnect, after successfully trialling the product (with SQL Server). However, after removing the trial version, and installing the new version, we’re unable to get the license key to apply.

The project we’re testing this with initially used System.Data-style DBML files in a Framework library; we converted these to lqml files and the library to .Net standard and these work fine with the trial version. After removing and reinstalling the full version, we’ve changed the connection string in the code to use the license key.

Using the context in a .Net core application appears to work fine. However, using the context from a Framework application throws an error. Here’s an example of the context being initialised:

Code: Select all

    var xdc = new classLibrary.ExampleContext(@"Data Source=sqlserver;Initial Catalog=myDatabase;User ID=user1;Password=xxx;License Key=nIzQMwNngKlwn9FTcy….;");

However, this gives the exception

Code: Select all

  Message=Keyword not supported: 'license key'.
   at System.Data.Common.DbConnectionOptions.ParseInternal(Hashtable parsetable, String connectionString, Boolean buildChain, Hashtable synonyms, Boolean firstKey)
   at System.Data.Common.DbConnectionOptions..ctor(String connectionString, Hashtable synonyms, Boolean useOdbcRules)
   at System.Data.SqlClient.SqlConnectionString..ctor(String connectionString)
   at System.Data.SqlClient.SqlConnectionFactory.CreateConnectionOptions(String connectionString, DbConnectionOptions previous)
   at System.Data.ProviderBase.DbConnectionFactory.GetConnectionPoolGroup(DbConnectionPoolKey key, DbConnectionPoolGroupOptions poolOptions, DbConnectionOptions& userConnectionOptions)
   at System.Data.SqlClient.SqlConnection.ConnectionString_Set(DbConnectionPoolKey key)
   at System.Data.SqlClient.SqlConnection.set_ConnectionString(String value)
   at Devart.Data.Linq.DataProvider.Initialize(Object connection)
   at Devart.Data.SqlServer.Linq.Provider.SqlDataProvider.Initialize(Object connection)
   at Devart.Data.Linq.DataProvider.a(IDataServices A_0, Object A_1)
   at Devart.Data.Linq.DataContext.a(Object A_0, MappingSource A_1, Type A_2, String A_3, Boolean A_4)
   at Devart.Data.Linq.DataContext..ctor(String connectionString, MappingSource mapping)
Running the same context from a .Net core application appears fine.

I can see from the above exception that System.Data is being used; I've no idea if this is "normal" or not, but it's not something I'm doing deliberately (and doesn't appear to cause an issue with Core). Can anyone help?

Site Admin
Posts: 9308
Joined: Thu 14 Aug 2008 12:44

Re: Unable to use license key in Framework applications

Post by Shalex » Thu 20 Aug 2020 18:31

The current implementation of LinqConnect includes two sets of assemblies:

1) the .NET Framework Devart.* assemblies which are shipped with installation:
* assemblies are created in "C:\Program Files (x86)\Devart\dotConnect\Linq\" and GAC
* licensed version "LinqConnect Professional" requires no licenses.licx entries and no License Key connection string parameter

2) the .NET Standard (.NET Core) Devart.* assemblies which are available via NuGet:
* you can download packages from https://www.nuget.org/packages/Devart.D ... erver.Linq
* licensing approach is described at https://www.devart.com/linqconnect/docs ... ndard.html
Using the context in a .Net core application appears to work fine. However, using the context from a Framework application throws an error.

Code: Select all

  Message=Keyword not supported: 'license key'.
Are you going to work with .NET Standard Devart.* assemblies (from NuGet) in .NET Framework project? In this case, reinstall LinqConnect and choose the option "Do not install assemblies in the GAC" not to load .NET Framework assemblies from GAC in runtime.

Post Reply