Reputation: 21
I use steema.teechart.net.4.2019.8.8 for WPF development. I need to specify a license in a non-exe assembly (A) which uses TChart control because I don't have an access to executing assembly (B). To do that I:
But this didn't work, I still see "This is an EVALUATION version ..." during runtime; while designtime everything is fine.
Can you please advise how to specify TeeChart.licenses not for an executing assembly, but for assembly actually using TChart?
PS:
Upvotes: 1
Views: 291
Reputation: 21
TeeChart tutorial says there is on option to call plugin-constructor to manually pass an assembly which contains license: But this doesn’t work actually for Steema.TeeChart.WPF.TChart (as of steema.teechart.net.4.2019.8.8). I decompiled the code and verified that those plugin constructors do nothing with passed instances.
Overall license pickup process looks like following:
In my case I just created steema.resources file dynamically and embedded there the license from non-executing assembly:
public static void FixTeeChartLicense(Assembly assembly)
{
var filename = "steema.resources";
if (File.Exists(filename))
{
return;
}
var resourceName = assembly.GetManifestResourceNames().FirstOrDefault(s => s.Contains("TeeChart.licenses"));
if (resourceName == null)
{
return;
}
using (var resourceStream = assembly.GetManifestResourceStream(resourceName))
using (var resourceWriter = new ResourceWriter(filename))
{
resourceWriter.AddResource("TeeChart", resourceStream);
}
}
Upvotes: 1