License with .NET standard libraries

License with .NET standard libraries

Postby powelerl » Sun 28 May 2017 15:17

Hi,

I have problems getting my license to work with the new scheme for .NET standard libraries.

Quote from https://www.devart.com/dotconnect/oracle/docs/LicensingStandard.html

Purchased dotConnect for Oracle Licensing

After you purchased dotConnect for Oracle, you will get a email with the license key. You can also view your key in the Registered User Area, where you download your licensed product installers.

You must add this license key to the License Key connection string parameter.


I can find "Activation Key" for dotConnect for Oracle Professional v9.4.280 at https://secure.devart.com/Licenses.aspx. This key does not work when entered in OracleConnectionStringBuilder.LicenseKey. I get the exception Devart.Common.LicenseException: 'Feature is not supported.'

I downloaded the v9.4.280 installer. The professional package did not help - I don't think it actually installs any license onto the system. But I installed the trial package, which works, so for now I can do some development at least.

Help appreciated
powelerl
 
Posts: 23
Joined: Thu 22 Dec 2016 10:00

Re: License with .NET standard libraries

Postby Shalex » Mon 29 May 2017 16:38

Please follow this walkthrough:

1. Create a test .NET Core project via Visual Studio > File > New > Project > Installed > Templates > Visual C# > .NET Core > Console Application (.NET Core).

2. Download Devart package via Tools > NuGet Package Manager > Package Manager Console:
Code: Select all
PM> install-package Devart.Data.Oracle.EFCore -Source:"https://www.nuget.org/api/v2/"

3. Run the code:
Code: Select all
    var builder = new Devart.Data.Oracle.OracleConnectionStringBuilder();
    builder.Direct = true;
    builder.Server = "...";
    builder.Sid = "...";
    builder.UserId = "...";
    builder.Password = "...";
    builder.LicenseKey = @"..."; // that is "Activation Key" in Customer Portal

    var conn = new Devart.Data.Oracle.OracleConnection(builder.ConnectionString);
    conn.Open();

Does it work?
Shalex
Devart Team
 
Posts: 7780
Joined: Thu 14 Aug 2008 12:44

Re: License with .NET standard libraries

Postby powelerl » Tue 30 May 2017 14:00

Yes, it works, and I discovered the reason why mine fails. I am using the .NET Standard Devart dlls with an application running on .NET Framework 4.6. If I switch to netcoreapp1.1 it works, but that is not a solution for me.

Problem is that the old licensing ceased to work when switching to the .NET Standard dlls (no code or setup changes, license file generated a long time a go). So what license model should I use in this case: the old or the new?
powelerl
 
Posts: 23
Joined: Thu 22 Dec 2016 10:00

Re: License with .NET standard libraries

Postby Shalex » Wed 31 May 2017 09:00

Current implementation for the licensed version:
powelerl wrote:Problem is that the old licensing ceased to work when switching to the .NET Standard dlls (no code or setup changes, license file generated a long time a go). So what license model should I use in this case: the old or the new?
Please use .NET Standard licensing approach with the .NET Standard dlls.
Shalex
Devart Team
 
Posts: 7780
Joined: Thu 14 Aug 2008 12:44

Re: License with .NET standard libraries

Postby powelerl » Wed 31 May 2017 10:03

Thanks, that was what I expected. I needed to be 100% sure though.

So .NET Standard assemblies can be used on multiple platforms, including .NET Core. It can also be used on Xamarin, .NET Framework and more.

The test you provided works for a .NET Core application, but not for an .NET Framework application (due to a licensing exception).

Shalex wrote:Please follow this walkthrough:

1. Create a test .NET Core project via Visual Studio > File > New > Project > Installed > Templates > Visual C# > .NET Core > Console Application (.NET Core).

2. Download Devart package via Tools > NuGet Package Manager > Package Manager Console:
Code: Select all
PM> install-package Devart.Data.Oracle.EFCore -Source:"https://www.nuget.org/api/v2/"

3. Run the code:
Code: Select all
    var builder = new Devart.Data.Oracle.OracleConnectionStringBuilder();
    builder.Direct = true;
    builder.Server = "...";
    builder.Sid = "...";
    builder.UserId = "...";
    builder.Password = "...";
    builder.LicenseKey = @"..."; // that is "Activation Key" in Customer Portal

    var conn = new Devart.Data.Oracle.OracleConnection(builder.ConnectionString);
    conn.Open();

Does it work?


Now, open the csproj file and change the target framework to .NET Framework v4.6.

<TargetFramework>net46</TargetFramework>

Then you get an exception, right?
powelerl
 
Posts: 23
Joined: Thu 22 Dec 2016 10:00

Re: License with .NET standard libraries

Postby Shalex » Fri 02 Jun 2017 13:26

powelerl wrote:So .NET Standard assemblies can be used on multiple platforms, including .NET Core. It can also be used on Xamarin, .NET Framework and more.
We didn't test our .NET Standard assemblies with Xamarin, so we do not guarantee a full compatibility with Xamarin.

powelerl wrote:The test you provided works for a .NET Core application, but not for an .NET Framework application (due to a licensing exception).
We will investigate this scenario and notify you about the result.
Shalex
Devart Team
 
Posts: 7780
Joined: Thu 14 Aug 2008 12:44

Re: License with .NET standard libraries

Postby ChangHyeon Lee » Wed 14 Jun 2017 06:04

I am experiencing a similar problem.

I created a simple console program using .NET standard libraries.
The target framework of my project file is as follows.
...
<TargetFramework>netcoreapp1.1</TargetFramework>
...

If I move the compiled binaries to Linux, I get the following error:

Code: Select all
Unhandled Exception: Devart.Common.LicenseException: Feature is not supported.
   at d.le.clv.Vld(Int32 pe)
   at Devart.Data.Oracle.OracleInternalConnection..ctor(bz connectionOptions, OracleInternalConnection proxyConnection)
   at Devart.Data.Oracle.by.a(g A_0, Object A_1, DbConnectionBase A_2)
   at Devart.Common.DbConnectionFactory.a(DbConnectionPool A_0, g A_1, DbConnectionBase A_2)
   at Devart.Common.DbConnectionPool.a(DbConnectionBase A_0)
   at Devart.Common.DbConnectionPool.GetObject(DbConnectionBase owningConnection)
   at Devart.Common.DbConnectionFactory.b(DbConnectionBase A_0)
   at Devart.Common.DbConnectionClosed.Open(DbConnectionBase outerConnection)
   at Devart.Common.DbConnectionBase.Open()
   at Devart.Data.Oracle.OracleConnection.Open()
   at ConsoleApp2.Program.Main(String[] args)
Aborted


Here is the code I wrote:
Code: Select all
        static void Main(string[] args)
        {
         Console.OutputEncoding = System.Text.Encoding.UTF8;

         var builder = new Devart.Data.Oracle.OracleConnectionStringBuilder("User ID=YYYYYYYY; Password=XXXXXXXX; Direct=true; Host=111.111.111.111; Service Name=ZZZZZZ; Port=1521;");
         builder.LicenseKey = @"My Activation Key";

         Devart.Data.Oracle.OracleConnection oraConnection = new Devart.Data.Oracle.OracleConnection(builder.ConnectionString);
         oraConnection.Unicode = true;
         oraConnection.Open();

         Devart.Data.Oracle.OracleCommand command = new Devart.Data.Oracle.OracleCommand();
         command.Connection = oraConnection;
         Devart.Data.Oracle.OracleDataReader dataReader = null;
         command.CommandText = "SELECT SEQ, NAME FROM TABLE";

         int i = 0;
         dataReader = command.ExecuteReader();
         while (dataReader.Read() && i < 10)
         {
            Decimal seq = (Decimal)dataReader.GetValue(0);
            string name = "";
            if (!dataReader.IsDBNull(1))
               name = (string)dataReader.GetValue(1);
            Console.WriteLine(string.Format("{0}\t{1}", seq, name));
            i++;
         }

         oraConnection.Close();

         Console.ReadLine();
        }



If I run it in Windows, it works fine.

In addition, dotConnect for MySQL generates the same error.

What is the problem?
ChangHyeon Lee
 
Posts: 1
Joined: Wed 14 Jun 2017 05:46

Re: License with .NET standard libraries

Postby Shalex » Wed 14 Jun 2017 19:13

Currently Linux is not supported (applying the License Key value fails). We are investigating the issue and will notify you about the result.
Shalex
Devart Team
 
Posts: 7780
Joined: Thu 14 Aug 2008 12:44

Re: License with .NET standard libraries

Postby Shalex » Wed 28 Jun 2017 12:27

The new build (v9.4.299) includes the following improvements:
  • The bug with applying the License Key connection string parameter (concerns .NET Standard 1.3 compliant assemblies only) on Linux is fixed
  • The bug with applying the License Key connection string parameter (concerns .NET Standard 1.3 compliant assemblies only) in .NET Framework projects is fixed
Shalex
Devart Team
 
Posts: 7780
Joined: Thu 14 Aug 2008 12:44


Return to dotConnect for Oracle