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