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

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
 
M

MSFT

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.)
 
N

Neil Davidson

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top