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.
Class library licensing problem
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.
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.
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.
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.
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.
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.