By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
454,245 Members | 1,340 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 454,245 IT Pros & Developers. It's quick & easy.

licensing component - designtime

P: n/a

I've developed a class that derives from component (rather than a
control), and am trying to license it at design time. I've set the
license attributes etc. to my custom license provider:


The problem is that my license provider never gets called at
designtime. To prove this, I've put this code into the implementation
of SM_LicenseProvder:

public override License GetLicense(LicenseContext context,
Type type, object instance, bool allowExceptions)
FileStream fs = new FileStream("d:\\lic.log",
System.IO.FileMode.Append, System.IO.FileAccess.Write);
string towrite = "";
if (context == null)
towrite = "context is null";
towrite = context.UsageMode.ToString();
byte[] b = System.Text.Encoding.ASCII.GetBytes(towrite);
fs.Write(b, 0, b.Length);

It gets called at RunTime no problem, but never DesignTime. I tried a
simple class that derives from TextBox and uses the same license
provider and sure enough it does get hit at design time. This leads me
to think that designtime licensing only works for 'Controls'.

So how do you license a component at design time? Am I missing

Nov 16 '05 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.