Class library licensing problem

Class library licensing problem

Postby bradk » Wed 24 May 2006 19:24

I've run into some undesireable behavior with the 2.5 Pro license and Enterprise Library 2.0. Maybe someone can explain. Here is my scenario:

Class Library A: directly uses the Corelab product, has licenses.licx. Registered in the GAC.

Class Library B: calls into class library A, does not use the Corelab product directly. Registered in the GAC.

Test Executable: Has a project reference to Class Library B. Calls class library B. Has a licenses.config.

This results in a licensing error, unless I also add a licenses.licx to class library B. This should not be required since it does not use the CoreLab product. This creates an undesirable coupling between class libraries A and B. For exampe, if class library B is business logic, it should not have to have awareness that class library A (data access layer) is using postgres or your product.

One background piece here is I have rebuilt your Enterprise Library project to be signed, and put it in the gac.

Please help me find a solution for this. Thanks.
bradk
 
Posts: 34
Joined: Thu 20 Apr 2006 01:42

Postby bradk » Wed 24 May 2006 20:58

Now I'm really confused. After a restart I ended up having to add a licenses.licx to the test exe as well. I must just not be clear on how this is supposed to work when there are multiple layers of class libraries involved.
bradk
 
Posts: 34
Joined: Thu 20 Apr 2006 01:42

Postby Alexey » Thu 25 May 2006 06:52

Just to clarify, you should have the following^
1. Create licenses.licx file with "CoreLab.PostgreSql.PgSqlConnection, CoreLab.PostgreSql" string in it (without spaces at the end of the string), add it to the class library A project as an embedded resource.
2. Create licenses.config with "YourMainApplication.exe" string inside (where "YourMainApplication" is the name of your Test Executable) and place it near licenses.licx file (without adding it to the project).
That's it.
Try to follow these steps one more time. If it won't help please send us test project to reproduce this problem.
Alexey
 
Posts: 2756
Joined: Mon 13 Mar 2006 07:43

Postby bradk » Thu 25 May 2006 13:37

ok, I will try again. One thing I have verified this morning that I found early on is the licenses.licx as you describe and as is documented does not work with GAC class libraries. You have to use a fully qualified assembly name:

CoreLab.PostgreSql.PgSqlConnection, CoreLab.PostgreSql, Version=2.50.15.0, Culture=neutral, PublicKeyToken=09af7300eec23701

If I use what you suggest I get a compile error:

licenses.licx(1): error LC0003: Unable to resolve type 'CoreLab.PostgreSql.PgSqlConnection, CoreLab.PostgreSql'

I'll work on starting from scratch with my scenario today, and may be sending you a project.
bradk
 
Posts: 34
Joined: Thu 20 Apr 2006 01:42

Postby Guest » Fri 26 May 2006 01:49

Your right it works. I still don't understand why, since I used the exact same licx file. All I did was remove all the licensing I had done and re-add it to the ClassLibraryA project only, build and gac everything in dependency order and voila.

At this point I've checked the project into source control... is there ever any reason to need to remove and re-add the licx file to the project ?

Keeping my fingers crossed.
Guest
 

Postby Alexey » Fri 26 May 2006 06:07

I don't think there would be any reason. (Anyway your source control shouldn't make any obstacles.)
Alexey
 
Posts: 2756
Joined: Mon 13 Mar 2006 07:43


Return to dotConnect for PostgreSQL