Home All Groups Group Topic Archive Search About

RE: Designtime licenses, I just don't get it

Author
29 Mar 2005 1:37 PM
serge calderara
I am in the same situation as yours. Simply trying to undersatand what is
going on when a compoent is in a way lisence with the Validating function. Of
course I undersatnd that the component is license at that point but then what
to provide to allows others to yuse it and to not get that llicences
exception ?

I am also looking a way to protect with a LIC file a simple class from
beeing instanciate if lic file not present and not corresponding to checked
striing but unfortunatly could not get real example to make it works.

Sounds reaaly tought for me to catch the logic beind all this.

If you manage to solev your case or understand the point or simply have
answer to my question thanks for your help

regards
serge

Show quoteHide quote
"kozw" wrote:

> Hi,
>
> I've been trying to figure out how the .NET Licensing is working, but I
> can't seem to understand it.
>
> I create a Licensed control using the standard LicFileLicenseProvider
> like this:
>
> [LicenseProvider(typeof(LicFileLicenseProvider))]
> public class LicensedLabel : Label
> {
> private License m_license;
>
> public LicensedLabel()
> {
> m_license = LicenseManager.Validate(typeof(LicensedLabel), this);
> }
> .....
> }
>
> I get a nice error dialog when dropping my LicensedLabel from the
> toolbox on my form. Good, I understand this, the LicensedLabel is
> instantiated in the DesignTime context by the designer.
>
> However, what is stopping me from *not* using the designer and just add
> the following code to my form:
>
> LicensedLabel l = new LicensedLabel;
> Controls.Add(l);
>
> Nobody is enforcing a design time check, my LicensedLabel is now just
> usable by anyone. What am I missing here?
>
> btw. I'm looking for a license solution for a class that is not derived
> from Control or Component.
>
> Thanks,
>
>
> kozw
>
>

Author
1 Apr 2005 2:02 AM
grant
LicenseManager.Validate should throw an exception at runtime when the
object is created if there is no compiled license and no license file
present.

License keys are compiled into your application by adding a
"license.licx" file to your project . If the component you are
developing is not added using the IDE designer then you (and your
clients) will need to manually add the .licx file to projects that use
the component . The build action for the .licx file should be set to
"Embedded Resource" and an entry added for your component/class eg:

LicensedControl_VB.MyControl, LicensedControl_VB

Here the first part of the entry specifies the name of the component or
class and the second part the name of the DLL that defines the
component classs.
When the application is compiled the compiler asks the LicenseProvider
for a design-time license and the provider stores the runtime license
key inside the application resources.

When you call Validate or IsValid at runtime the provider first checks
if there is a runtime license embedded as a resource and if not then
checks if there is a licx file.  One of the shortcomings of the
standard LicFileLicenseProvider is that the runtime license keys it
embeds are the same as the design time keys - which means that it is
fairly simple for someone to get hold of a valid design time license
key just by decompiling an application that uses your component or
class.

Infralution offers a very simple to use, secure and reasonably priced
licensing solution that you might want to consider.   See our website
for a fully functional trial version
(www.infralution.com/licensing/html)

Regards
Grant Frisken
Infralution
Author
1 Apr 2005 10:00 PM
Richard L Rosenheim
The book, Programming Microsoft Visual Basic .NET by Francesco Balena has a
section that explains how to implement your own licensing.

Richard Rosenheim


<gr***@infralution.com> wrote in message
Show quoteHide quote
news:1112320942.776728.27800@z14g2000cwz.googlegroups.com...
> LicenseManager.Validate should throw an exception at runtime when the
> object is created if there is no compiled license and no license file
> present.
>
> License keys are compiled into your application by adding a
> "license.licx" file to your project . If the component you are
> developing is not added using the IDE designer then you (and your
> clients) will need to manually add the .licx file to projects that use
> the component . The build action for the .licx file should be set to
> "Embedded Resource" and an entry added for your component/class eg:
>
> LicensedControl_VB.MyControl, LicensedControl_VB
>
> Here the first part of the entry specifies the name of the component or
> class and the second part the name of the DLL that defines the
> component classs.
> When the application is compiled the compiler asks the LicenseProvider
> for a design-time license and the provider stores the runtime license
> key inside the application resources.
>
> When you call Validate or IsValid at runtime the provider first checks
> if there is a runtime license embedded as a resource and if not then
> checks if there is a licx file.  One of the shortcomings of the
> standard LicFileLicenseProvider is that the runtime license keys it
> embeds are the same as the design time keys - which means that it is
> fairly simple for someone to get hold of a valid design time license
> key just by decompiling an application that uses your component or
> class.
>
> Infralution offers a very simple to use, secure and reasonably priced
> licensing solution that you might want to consider.   See our website
> for a fully functional trial version
> (www.infralution.com/licensing/html)
>
> Regards
> Grant Frisken
> Infralution
>
Author
4 Apr 2005 9:33 AM
serge calderara
Hi,

What should be the content of the license.licx file then ?
Or to generate it ?

regards
serge

Show quoteHide quote
"gr***@infralution.com" wrote:

> LicenseManager.Validate should throw an exception at runtime when the
> object is created if there is no compiled license and no license file
> present.
>
> License keys are compiled into your application by adding a
> "license.licx" file to your project . If the component you are
> developing is not added using the IDE designer then you (and your
> clients) will need to manually add the .licx file to projects that use
> the component . The build action for the .licx file should be set to
> "Embedded Resource" and an entry added for your component/class eg:
>
> LicensedControl_VB.MyControl, LicensedControl_VB
>
> Here the first part of the entry specifies the name of the component or
> class and the second part the name of the DLL that defines the
> component classs.
> When the application is compiled the compiler asks the LicenseProvider
> for a design-time license and the provider stores the runtime license
> key inside the application resources.
>
> When you call Validate or IsValid at runtime the provider first checks
> if there is a runtime license embedded as a resource and if not then
> checks if there is a licx file.  One of the shortcomings of the
> standard LicFileLicenseProvider is that the runtime license keys it
> embeds are the same as the design time keys - which means that it is
> fairly simple for someone to get hold of a valid design time license
> key just by decompiling an application that uses your component or
> class.
>
> Infralution offers a very simple to use, secure and reasonably priced
> licensing solution that you might want to consider.   See our website
> for a fully functional trial version
> (www.infralution.com/licensing/html)
>
> Regards
> Grant Frisken
> Infralution
>
>
Author
5 Apr 2005 2:49 AM
grant
The licenses.licx file (note it should be "licenses.licx" not
"license.licx" as per my last message) should contain a line for your
class like this:

MyNamespace.MyClass, MyClassBinary

Where "MyNamespace.MyClass" is the fully qualified name of your class
and
"MyClassBinary" is the name of the DLL that defines your class (without
any .dll extension)