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

licensing component - designtime

P: n/a
Hi,

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:

[LicenseProvider(typeof(SM_LicenseProvider))]

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";
}
else
{
towrite = context.UsageMode.ToString();
}
byte[] b = System.Text.Encoding.ASCII.GetBytes(towrite);
fs.Write(b, 0, b.Length);
fs.Close();

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
something?

Stew
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.