Do I need to upgrade?

Discussion of open issues, suggestions and bugs regarding ADO.NET provider for MySQL
Post Reply
KrisF
Posts: 3
Joined: Wed 11 Oct 2017 13:10

Do I need to upgrade?

Post by KrisF » Wed 11 Oct 2017 18:44

We originally purchased dotConnect for MySQL Professional Edition v 5.0.20.0. We licensed and ran our original product on Windows XPe SP3 having built the application using Visual Studio 2008 Professional Edition and .NET Framework v 3.5 SP1. It's still running great! Unfortunately, some of the hardware components are reaching end of life and can no longer be purchased. So, we are porting to new hardware that is running Windows 10 and building the application using Visual Studio Professional 2015 Update 3 and .NET Framework v 4.6.1. Ideally, we would like to continue using the same licenses.licx licensing scheme (transparent), but we have encountered a problem. On our new platform, when we attempt to connect to our MySQL server, we get the following error, "Connection error: Assembly that contains embedded dotConnect for MySQL license cannot be used with this application: <<our-application-name>>>. Please correct license information." Also, in VS Pro 2015, we are not seeing the MySQL item under the Tools menu, but we were (are) able to see it when using VS 2008. Here, https://www.devart.com/dotconnect/mysql ... ml#compile, I noticed and attempted Compiling License Manually, but my attempt was unsuccessful ... same error. Do I need to upgrade or can I get this old dotConnect for MySQL version running??? Any help will be most appreciated. Thanks for reading.
-KrisF

Pinturiccio
Devart Team
Posts: 2420
Joined: Wed 02 Nov 2011 09:44

Re: Do I need to upgrade?

Post by Pinturiccio » Thu 12 Oct 2017 13:22

KrisF wrote:Assembly that contains embedded dotConnect for MySQL license cannot be used with this application
Visual Studio 2015 passes parameters to lc.exe differently than older Visual Studio versions. Starting with dotConnect for MySQL 8.3.422, we have taken these differences into account and correctly process parameters, passed by Visual Studio 2015, correctly. For more information, please refer to https://www.devart.com/dotconnect/mysql ... story.html

With Visual Studio 2015, you need to use dotConnect for MySQL 8.3.422 or higher in order to have no such issues. However, you can use Visual Studio 2015 even with dotConnect for MySQL of a version older than 8.3.422. In the latter case you have to compile license resources manually.

The license resource can be compiled in the following way:
1. Create a text file named licenses.licx and enter the following text inside the licenses.licx file:
Devart.Data.MySql.MySqlConnection, Devart.Data.MySql

2.Generate the license resource file using the following command line:
"%Compiler Path%\lc.exe /target:MyApplication.exe /complist:licenses.licx /i:"%Assembly Path%\Devart.Data.MySql.dll"

Where:

- %Compiler Path% is the path to the appropriate lc.exe file (for example, C:\Program Files\Microsoft.NET\SDK\v2.0\Bin);
- MyApplication.exe is the name of your target executable file. If you want to compile a license resource for a class library project, specify MyApplication.dll instead of MyApplication.exe, where MyApplication.dll is the name of the class library.
- licenses.licx is your licenses.licx file. Place the licenses.config file in the same folder as the licenses.licx file for a class library project;
- %Assembly Path% is the Devart.Data.MySql.dll assembly location;

3. The License compiler will generate the 'MyApplication.exe.licenses' ('MyApplication.dll.licenses' for class library project) resource file;

4. Add this file to your project as an embedded resource.

For more information, please refer to https://www.devart.com/dotconnect/mysql ... ml#compile
KrisF wrote:Also, in VS Pro 2015, we are not seeing the MySQL item under the Tools menu, but we were (are) able to see it when using VS 2008.
Visual Studio 2015 is supported starting from dotConnect for MySQL 8.4.464. For more information, please refer to https://www.devart.com/dotconnect/mysql ... story.html . Thus you cannot use Devart components in toolbox in Visual Studio 2015 with dotConnect for MySQL 5.0.20.

To make a conclusion, you can compile the license resource manually and use dotConnect for MySQL 5.0.20 in Visual Studio 2015. But if you want to use Devart components in Visual Studio 2015 toolbox and have other features available after integration to Visual Studio 2015, you need to update your dotConnect for MySQL.

KrisF
Posts: 3
Joined: Wed 11 Oct 2017 13:10

Re: Do I need to upgrade?

Post by KrisF » Thu 12 Oct 2017 18:15

Pinturiccio,

As you might have noticed in my original email, I did attempt to compile the license resource manually and lc.exe did, in fact, create the expected <my-application>.exe.licenses. I believe that I followed the instructions properly and added that file as an embedded resource using VS 2015. Then, I rebuilt the application, loaded it on my target, and attempted to run it, but it gave me the exact same error. Note that my overall application consists of one executable and several DLLs. The EXE itself does not reference the Devart assembly, but at least two of the DLLs do. I did not create any <my-application>.dll.licenses files. Do I need to do the manual compilation for every component???

Lastly, just fyi, I did download the trial version of the latest dotConnect for MySQL v 8.9.980.0 and used it with VS 2015. I rebuilt the application, loaded it on my target, and it ran successfully. I was able to establish a test connection with our MySQL server. So, the fallback plan is to upgrade, but if possible, our desire is to continue using the old v 5.0.20.0.

Thanks for your help.
-KrisF

Pinturiccio
Devart Team
Posts: 2420
Joined: Wed 02 Nov 2011 09:44

Re: Do I need to upgrade?

Post by Pinturiccio » Fri 13 Oct 2017 16:06

KrisF wrote:As you might have noticed in my original email, I did attempt to compile the license resource manually
Please describe the steps you performed in details. Which command line with parameters do you use with the lc.exe tool. Where is the licenses.licx file located? Send us its content. Where are dotConnect for MySQL assemblies located? dotConnect for MySQL of which version is installed on your computer?
KrisF wrote:The EXE itself does not reference the Devart assembly, but at least two of the DLLs do. I did not create any <my-application>.dll.licenses files. Do I need to do the manual compilation for every component???
Our license validator looks for the valid license in the following way:
*.exe -> FirstCalledClassLibrary.dll -> ... -> LastCalledClassLibrary.dll.
The valid license for *.exe has to be available on one of the levels of this chain: either built in *.exe (licenses.licx), or added to one of the used class libraries (licenses.licx + licenses.config with the name of *.exe).
Thus, it's enough to add the license resource to the exe file.
KrisF wrote:So, the fallback plan is to upgrade, but if possible, our desire is to continue using the old v 5.0.20.0.
None of our users, who wanted to use old dotConnect version with Visual Studio 2015, had problems with manual license resource compillation. We probably will find the reason of this issue so that you could compile the license resource correctly.
However, please note that dotConnect for MySQL 5.0.20 does not support Visual Studio 2015, and Visual Studio 2015 integration is available only in newer dotConnect for MySQL versions.

Post Reply