Page 1 of 1

Compilation error in 64bit Windows 7

Posted: Wed Aug 04, 2010 8:11 am
by 9639355
Hello,
I'm using v2.0.2179.x in my application.
Recently tried to build my application in a 64 bit Windows 7 OS but the project that used TeeChart gives strange compilation errors.
Error 3 Specific exception: "XmlException" Message: "Type in the data at line 774, position 3, cannot be loaded because it threw the following exception during construction: Object reference not set to an instance of an object. ---> XmlException: Type in the data at line 774, position 3, cannot be loaded because it threw the following exception during construction: Object reference not set to an instance of an object. Line 774, position 3. ---> NullReferenceException: Object reference not set to an instance of an object." C:\Revolution\Windows Build .NET\Revolution\EngineeringUI\CalibrationWizardLiveData.resx EngineeringUI

When I posted this issue on MSDN forum, I was told that the exact cause of the error was
NullReferenceException: Object reference not set to an instance of an object.

at Steema.TeeChart.FrAccessProvider.GetLicense(LicenseContext context, Type type, Object instance, Boolean allowExceptions)
at System.ComponentModel.LicenseManager.ValidateInternalRecursive(LicenseContext context, Type type, Object instance, Boolean allowExceptions, License& license, String& licenseKey)
at System.ComponentModel.LicenseManager.Validate(Type type, Object instance)
at Steema.TeeChart.Chart..ctor()
at Steema.TeeChart.Chart..ctor(SerializationInfo info, StreamingContext context)
d:\projects\vs10\WindowsFormsApplication1\WindowsFormsApplication1\Form1.resx WindowsFormsApplication1
it seems to be a code defect in TeeChart.dll (TeeChart, Version=2.0.2179.21172, Culture=neutral, PublicKeyToken=9c8126276c77bdb7), with reflector, we can view "source code" in TeeChart.dll, FrAccessProvider.GetLicense method looks like:

public override License GetLicense(LicenseContext context, Type type, object instance, bool allowExceptions)
{
FrAccess access = null;
if (context != null)
{
if (context.UsageMode == LicenseUsageMode.Runtime)
{
string savedLicenseKey = context.GetSavedLicenseKey(type, null);
if ((savedLicenseKey != null) && this.IsRuntimeKeyValid(savedLicenseKey, type))
{
access = new FrAccess(this, savedLicenseKey);
}
}
if (access != null)
{
return access;
}

// NullRefernceException occurs here.
RegistryKey key = Registry.LocalMachine.OpenSubKey(@"Software\Steema Software\TeeChart.Net");
string str2 = (string)key.GetValue("DesignKeyV2", "");
if (((key != null) && (str2 != null)) && this.IsKeyValid(str2, type))
{
access = new FrAccess(this, string.Format("{0} is a licensed component.", type.FullName));
}

if (access != null)
{
context.SetSavedLicenseKey(type, access.LicenseKey);
}
}
return access;
}

On installing TeeChart on the machine, I noticed in the registry that the path to the key is HKEY_LOCAL_MACHINE\SOFTWARE\wow6432node\Steema Software\teeChart.Net\DesignKeyV2

Is the key returned as null, because of the difference in path? I tried to run the latest TeeRegV2.exe also. But to no success.

Could you please help me to resolve this issue.

Thanks.

Re: Compilation error in 64bit Windows 7

Posted: Fri Aug 06, 2010 2:29 pm
by yeray
Hi JamesThomas,

Is a new simple application working fine in this 64 bit machine?