Adding License Manually - please clarify

Discussion of open issues, suggestions and bugs regarding ADO.NET provider for MySQL
dghundt
Posts: 38
Joined: Thu 24 Aug 2006 01:16

Adding License Manually - please clarify

Post by dghundt » Thu 24 Aug 2006 02:11

Seems like I have things working (my read statement works), but I get a license error when I run my application. I have looked at your instructions but will need some additional help please.


Adding License Manually

Create a file named licenses.licx, if this file does not exists yet.
1. where do I create this file? Where would it exist if it did?

Open the file with a text editor and place this line inside:
CoreLab.MySql.MySqlConnection, CoreLab.MySql
2. ok, easy enough

Save the file and add it to your project.
3. How do I add it to my project? where, how?

Make sure it is embedded as a resource. To do this, in Visual Studio .NET view properties of the file and check that Build Action is set to Embedded Resource.
4. If I do steps 1-3 will it be embedded as a resource? Is something eles required?

many thanks!

Alexey
Posts: 2756
Joined: Mon 13 Mar 2006 07:43

Post by Alexey » Mon 28 Aug 2006 06:55

1. where do I create this file? Where would it exist if it did?
Create it in the main folder of your application, near Program.cs file. If it exists you may find it using windows search.
2. ok, easy enough
Agree
3. How do I add it to my project? where, how?
Click Project-->Add Existing Item... submenu and then choose the file from the dialog window.
4. If I do steps 1-3 will it be embedded as a resource? Is something eles required?
Commonly that will do. If not, inform us providing full version of Visual Studio you use (Professional, Standard?); your hardware architecture; version of MySQLDirect .NET (Std, Pro, Mobile); type of the project you create (class library, executable application, web project, web project with dynamically compiled sources).

Ski
Posts: 10
Joined: Mon 11 Sep 2006 20:10

This did not work for me.

Post by Ski » Mon 11 Sep 2006 20:19

Hello all,

I attempted to follow the aforementioned steps and i still get the "License not found. ..." message.

I have a Managed C++ .NET Solution which contains 2 projects. I am compiling the solution in debug mode.

The Solution is called TestDataLoader.
One project is called DataEngine.
The second project is called DataLoader.

I have copied the Licenses.licx from the examples directory to the Solution directory as well as each Project directory. I have tried adding the license.licx file to one / both projects as well as the Solution using Project->Add Existing Item... Currently the licenses.licx file has been added to both projects and Solution with no success.

Please help because I know the clock is running on the Trail period.

Regards,

Ski

Ski
Posts: 10
Joined: Mon 11 Sep 2006 20:10

Additional Information

Post by Ski » Mon 11 Sep 2006 22:58

The project is a simple Windows Forms (.exe) application created with VS 2003 Pro C++.NET. No network stuff included, just a local app on an isolated machine. MySql database is 5.0.15.

Computer is a dual 3.2 gig XEON Compaq box with 2 gigs of RAM and WINDOWS XP PRO.

In the Projects I am adding a reference to the CoreLab.Mysql and then adding "using namespace CoreLab::MySql;" in the header files.

I have removed the reference to MySql.Data and the "using namespace MySql::Data::MySqlClient" from the header files.

Regards,

Ski

Alexey
Posts: 2756
Joined: Mon 13 Mar 2006 07:43

Post by Alexey » Tue 12 Sep 2006 14:57

It is known VC++ issue. Please take a look to the appropriate forum topic:
http://crlab.com/forums/viewtopic.php?p=14367.

Ski
Posts: 10
Joined: Mon 11 Sep 2006 20:10

So where does DbTable.exe.licenses come from?

Post by Ski » Tue 12 Sep 2006 17:05

It is still not clear to me from the other post.

I found the line /ASSEMBLYRESOURCE:Debug\DbTable.exe.licenses in the other post, but where exactly does "DbTable.exe.licenses" come from? Please provide some more explanation

2 days and counting on the trial period.

Regards,

Gary Slovikosky

Alexey
Posts: 2756
Joined: Mon 13 Mar 2006 07:43

Post by Alexey » Wed 13 Sep 2006 09:34

This describes how to compile the required resource manually.
Generate licensing resource file using following command line:
"%Compiler Path%\lc.exe" /target:MyApplication.exe /complist:licenses.licx /i:"%Assembly Path%\CoreLab.MySql.dll"
Where %Compiler Path% is a path to appropriate lc.exe file (for example, C:\Program Files\Microsoft Visual Studio .NET 2003\SDK\v1.1\Bin in case of .NET Framework 1.1);
MyApplication.exe is name of your target executable file;
licenses.licx is a text file described earlier in this topic;
%Assembly Path% is location of CoreLab.MySql.dll assembly
Substitute these arguments with actual values. If license compiler fails with error, try adding full assembly specification to licenses.licx file, for example:
CoreLab.MySql.MySqlConnection, CoreLab.MySql, Version=3.50.12.0, Culture=neutral, PublicKeyToken=09af7300eec23701
License compiler will generate 'MyApplication.exe.licenses' resource file. You should add this file to your project as embedded resource (as described in another post).

Ski
Posts: 10
Joined: Mon 11 Sep 2006 20:10

I still get the same error message

Post by Ski » Wed 13 Sep 2006 17:42

One more time,

I was able to create the MyApplication.exe.licenses file and add it to the application, but I still get the same message "License not found. ...".

I did have to add the Version=3.50.12 ... etc, etc information for it to work.

I was wondering if the problem may be in the fact that the license file is added to the main application, but most of my data access happens in a class which is compiled as a library file and linked in. I also added it into the librarian command line but I get the same error.

The code is like this


IDbConnection * ClassConnection ;

// later ....

IDbConnection * GetConnection(String * ConnectionString)
{
switch(ClassRequestedType) // equals MySQL enumerator
{
case ORACLE : return new OracleConnection(ConnectionString) ;
case SQL : return new SqlConnection(ConnectionString) ;
case MySQL : return new CoreLab::MySql::MySqlConnection(ConnectionString) ;
}
}


// later ...

this->ClassConnection = this->GetConnection(ConnectionString)
this->ClassConnection->Open() ;


I cannot send any more code than this because of business restrictions.

3rd day since start of trial and still trying...

Regards,

Gary Slovikosky

Alexey
Posts: 2756
Joined: Mon 13 Mar 2006 07:43

Post by Alexey » Thu 14 Sep 2006 06:09

Did you add the line like this:
/ASSEMBLYRESOURCE:Debug\DbTable.exe.licenses ?
Did you try to perform steps described in "Licensing" topic of our
documentation (regarding class libraries)?

Ski
Posts: 10
Joined: Mon 11 Sep 2006 20:10

This does not work

Post by Ski » Thu 14 Sep 2006 19:36

I have tried to follow the directions in the on-line CoreLab help. It does not work. There is constant reference to "Embedded Resource" but I can find no place to do this.

When I add the file (either licenses.licx or exe.licences or MyApplication.exe.licenses) to my solution, or my main Windows Forms application, or to my library in the solution, I right click it, select ->Properties, the dialog box has no mention of "Embedded Resource".

Visual Studio .NET 2003 also has no reference to "Embedded Resources". I have searched under Embedded, Resources and Embedded Resources.

4 days and counting until the end of the Trail period and it still will not run!

Gary Slovikosky

Alexey
Posts: 2756
Joined: Mon 13 Mar 2006 07:43

Post by Alexey » Fri 15 Sep 2006 08:34

Try to do the following:
1. Create a new project.
2. Add one connection component.
3. Compile license resource manually (as it was described) and add it to the project.
4. Right-click the project, select properties, go to the Linker/Command Line option, enter appropriate string (like
/ASSEMBLYRESOURCE:Debug\DbTable.exe.licenses).
5. Add connection->Open() call to the code.
6. Run the project.
7. Inform me on results.

Ski
Posts: 10
Joined: Mon 11 Sep 2006 20:10

Still does not work

Post by Ski » Tue 19 Sep 2006 21:41

I did exactly as you requested and it still did not work.

I did the following steps:

1. Created a C++ .NET (2003) Windows forms Application (CoreLab)

2. Added a MySqlConnection object to the form ( shows as mySqlConnection1)

3. Added one command button (button1) to run the app.

4. Compiled the application to create an EXE.

5. Created the CoreLab.exe.licenses file in the Debug directory

6. Added the /ASSEMBLYRESOURCE:Debug\CoreLab.exe.licenses file into the Linker\Command Line\Additional Options.

7. added mySqlConnnection1->Open() ; to the code two different ways.

A: Tried selecting the mySqlConnection1 object and set the properties for database, username, password directly.

try
{
mySqlConnection1->Open() ;
}
catch (CoreLab::MySql::MySqlException * ex)
{
MessageBox::Show(ex->Message->ToString()) ;
}


B: Tried adding the following code

try
{
CoreLab::MySql::MySqlConnection * conn = new CoreLab::MySql::MySqlConnection(S"Database=MyDB;User Id=MyID; Password=MyPW") ;

conn->open() ;
}
catch (CoreLab::MySql::MySqlException * ex)
{
MessageBox::Show(ex->Message->ToString()) ;
}



I still get the error message "License not found. Please view "Licensing" topic in ....." with both attemtps

Regards,


Ski

dghundt
Posts: 38
Joined: Thu 24 Aug 2006 01:16

Post by dghundt » Wed 20 Sep 2006 00:49

I wound up just dragging a mysql connection from the tool box onto my main windows form, and it worked fine.

Ski
Posts: 10
Joined: Mon 11 Sep 2006 20:10

That didn't work for me

Post by Ski » Wed 20 Sep 2006 06:05

dghundt,

I did exactly that in Step 2 of my previous post.

I set the parameters in the Properties Page for Username, Password, Server, Database. I still got the "License error".

Did you use C++.NET or C# or VB.NET?

Regards,

Ski

Alexey
Posts: 2756
Joined: Mon 13 Mar 2006 07:43

Post by Alexey » Wed 20 Sep 2006 06:16

Dear Mr. Slovikosky, send me all your source files and compiled binaries.

Post Reply