Licensing a component without a user interface at design / compile time

  • Thread starter Thread starter Neil Davidson
  • Start date Start date
N

Neil Davidson

We have a component without a user interface which we want to license
at design time.

If someone has a design-time license then they should be able to
compile applications using the component, but if they do not have a
design time license then they should not be able to do this.

The component does not have a user interface so its constructor is
never called at design- or compile- time. The LicenseProvider
attribute does not seem to work in this case.

Is there any way to do this?

Thanks,

Neil
 
Hi Neil,

Did you component inherit from System.ComponentModel.Component? Based on my
test, its New method will be executed when we add it to a form at design
time. Therefore, we can add the license validating code here.

Luke
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)
 
Thanks for the reply. The component has no UI so it isn't added to the form
at design time.

I figured out what the problem was eventually though; I didn't understand
the role of the licenses.licx and didn't realize I needed to create it
manually. Once I'd done that it worked fine.

- Neil
 
Back
Top