Infralution
Joined: 28 Feb 2005 Posts: 5027
|
Posted: Thu Jun 23, 2005 12:00 am Post subject: Why aren't runtime licenses working for my component? |
|
|
I am building a licensed component. The design time license seems to install OK in my Test application - but when I run the test exe there is no runtime license installed and the evaluation message pops up. How do I get this to work?
There are several things you need to ensure to get the runtime licenses install correctly:
1. Ensure that the type you are licensing has the LicenseProvider attribute defined for it eg
Code: |
[LicenseProvider(typeof(MyControlLicenseProvider))]
public class MyComponent
|
2. Ensure that your test application has a licenses.licx file defined and included in the project as an embedded resource. The licenses.licx file should include a line like:
MyNamespace.MyComponent, MyDLLName
See the “Component and Control Licensing” section in our documentation for more info. If you add you component to the test form using the designer toolbox then VisualStudio should automatically create the licx file for you (if you have done step 1). If VisualStudio added the file then you should check that the version information is correct. It is a good idea to remove this additional information from the license.licx files of sample projects as it ties the license file to a particular version of your component and can cause problems later if you update the component version and forget to update the licx file.
Once you have done the above select “Rebuild Solution” for your test application. You need to use rebuild because the compiler does not detect changes to the licx file alone and so won’t rebuild automatically.
A good way to test whether you have got the first two steps right is to delete the license file for your type from the test application bin directory (ie remove the design time license). Then select “Rebuild Solution”. When the compiler compiles the licx files it creates an instance of each of the listed licensed types. Your licensing code (included in the constructor of the licensed type) should be then executed displaying the LicenseInstallForm. _________________ Infralution Support |
|