Page 1 of 1

Problems with distributing C# application with TeeChart

Posted: Fri Jan 12, 2007 7:22 pm
by 9641771
I've made a big progect with many different forms. Some of them uses teeChart. I placed EXE file, TeeChart.dll, TeeChart.Languages.dll and TeeChart.OpenGL.dll in the same folder on computer where TeeChart is not installed to. While running this application I faced an error
Image
Full text of this exception is:

Code: Select all

See the end of this message for details on invoking 
just-in-time (JIT) debugging instead of this dialog box.

************** Exception Text **************
System.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.ValidateInternal(Type type, Object instance, Boolean allowExceptions, License& license)
   at System.ComponentModel.LicenseManager.Validate(Type type, Object instance)
   at Steema.TeeChart.Chart..ctor()
   at Steema.TeeChart.TChart..ctor()
   at DiagFiles.PriemVzlet.InitializeComponent()
   at DiagFiles.PriemVzlet..ctor(String path, String bortNo, String engineNo, String ExpressFlightData, Byte ExpressFlightNum)
   at DiagFiles.Form1.button1_Click(Object sender, EventArgs e)
   at System.Windows.Forms.Control.OnClick(EventArgs e)
   at System.Windows.Forms.Button.OnClick(EventArgs e)
   at System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent)
   at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
   at System.Windows.Forms.Control.WndProc(Message& m)
   at System.Windows.Forms.ButtonBase.WndProc(Message& m)
   at System.Windows.Forms.Button.WndProc(Message& m)
   at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
   at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
   at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)


************** Loaded Assemblies **************
mscorlib
    Assembly Version: 2.0.0.0
    Win32 Version: 2.0.50727.42 (RTM.050727-4200)
    CodeBase: file:///F:/WINDOWS/Microsoft.NET/Framework/v2.0.50727/mscorlib.dll
----------------------------------------
DiagFiles
    Assembly Version: 1.0.0.0
    Win32 Version: 1.0.0.0
    CodeBase: file:///F:/Documents%20and%20Settings/alex/Рабочий%20стол/Diag.exe
----------------------------------------
System.Windows.Forms
    Assembly Version: 2.0.0.0
    Win32 Version: 2.0.50727.42 (RTM.050727-4200)
    CodeBase: file:///F:/WINDOWS/assembly/GAC_MSIL/System.Windows.Forms/2.0.0.0__b77a5c561934e089/System.Windows.Forms.dll
----------------------------------------
System
    Assembly Version: 2.0.0.0
    Win32 Version: 2.0.50727.42 (RTM.050727-4200)
    CodeBase: file:///F:/WINDOWS/assembly/GAC_MSIL/System/2.0.0.0__b77a5c561934e089/System.dll
----------------------------------------
System.Drawing
    Assembly Version: 2.0.0.0
    Win32 Version: 2.0.50727.42 (RTM.050727-4200)
    CodeBase: file:///F:/WINDOWS/assembly/GAC_MSIL/System.Drawing/2.0.0.0__b03f5f7f11d50a3a/System.Drawing.dll
----------------------------------------
System.Configuration
    Assembly Version: 2.0.0.0
    Win32 Version: 2.0.50727.42 (RTM.050727-4200)
    CodeBase: file:///F:/WINDOWS/assembly/GAC_MSIL/System.Configuration/2.0.0.0__b03f5f7f11d50a3a/System.Configuration.dll
----------------------------------------
System.Xml
    Assembly Version: 2.0.0.0
    Win32 Version: 2.0.50727.42 (RTM.050727-4200)
    CodeBase: file:///F:/WINDOWS/assembly/GAC_MSIL/System.Xml/2.0.0.0__b77a5c561934e089/System.Xml.dll
----------------------------------------
TeeChart
    Assembly Version: 2.0.2306.26232
    Win32 Version: 2.0.2306.26232
    CodeBase: file:///F:/Documents%20and%20Settings/alex/Рабочий%20стол/TeeChart.DLL
----------------------------------------
System.Data
    Assembly Version: 2.0.0.0
    Win32 Version: 2.0.50727.42 (RTM.050727-4200)
    CodeBase: file:///F:/WINDOWS/assembly/GAC_32/System.Data/2.0.0.0__b77a5c561934e089/System.Data.dll
----------------------------------------

************** JIT Debugging **************
To enable just-in-time (JIT) debugging, the .config file for this
application or computer (machine.config) must have the
jitDebugging value set in the system.windows.forms section.
The application must also be compiled with debugging
enabled.

For example:

<configuration>
    <system.windows.forms jitDebugging="true" />
</configuration>

When JIT debugging is enabled, any unhandled exception
will be sent to the JIT debugger registered on the computer
rather than be handled by this dialog box.
After that I made a simple application with code like that

Code: Select all

using System;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;

namespace DiagFiles
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
           
        }

     private void Form1_Load(object sender, EventArgs e)
     {
     tChart1.FillSampleValues();
     }
}
}
and it worked fine.
I've noticed that licenses.licx files from these applications are similar.

So could you tell me what is going on. Please write me a list of actions I should make to ensure that my applications will run on all platfoms.
Thank you.

Posted: Mon Jan 15, 2007 9:52 am
by narcis
Hi bairog,

When deploying your application did you included licenses.licx you used to compile the application?

Posted: Mon Jan 15, 2007 3:36 pm
by 9641771
Yes, I've also included this file. First (big) application didn't work.
By the way after deploying my second (small) application worked fine without this file (only EXE file, TeeChart.dll).

So could you tell me the way how to make my first application work?

Posted: Mon Jan 15, 2007 3:50 pm
by narcis
Hi bairog,

Can you please read this message about the same issue? If it doesn't help don't hesitate to let us know.

Posted: Mon Jan 15, 2007 4:25 pm
by 9641771
Thank you. It seems to be I solved this problem. I used teeRegister utility and all worked fine. If I am not wrong this utility added only one key to the registry:
[HKEY_LOCAL_MACHINE\SOFTWARE\Steema Software\TeeChart.NET]
"DesignKeyV2"="Steema.TeeChart.TChart is a licensed component."


So could you tell me, should I always manually add this key to the registry of computer I am deploing my application on or maybe there is enother easier way (and why my second application worked fine without these registry manipulations)?

Enother question: I built my applications with August verion of teeChart. There is enother release available for download on your site. Could you tell me how can I correctly upgrade my teeChart and make my big progect work with new version without remaking it.

Thank you.

Posted: Tue Jan 16, 2007 8:08 am
by narcis
Hi bairog,

Using TeeRegister is not the proper solution. You should try and check if the license is correctly compiled in your project as Marc told in the other thread.
Enother question: I built my applications with August verion of teeChart. There is enother release available for download on your site. Could you tell me how can I correctly upgrade my teeChart and make my big progect work with new version without remaking it.
I'm afraid you'll have to build your projects with the new version of TeeChart.

Posted: Tue Jan 16, 2007 11:00 am
by 9641771
narcis wrote:You should try and check if the license is correctly compiled in your project as Marc told in the other thread.
I've read that tread and followed Marc's advice
Marc wrote:To check whether the license is correctly compiled into your application you can modify the registry line in the machine where you compile the application:

Code: Select all

[HKEY_LOCAL_MACHINE\SOFTWARE\Steema Software\TeeChart.NET] 
"DesignKey"="Steema.TeeChart.TChart is a licensed component." 
invalidating it to:

Code: Select all

[HKEY_LOCAL_MACHINE\SOFTWARE\Steema Software\TeeChart.NET] 
"DesignKey"="xxxxSteema.TeeChart.TChart is a licensed component."
If the application reports a license compile error then the license was being correctly compiled into the application, if not then, assuming the teechart.dll file is the same on both designtime machine and server, it's possible that:
- the licenses.licx file is not part of the project as an embedded resource
or
- the licenses.licx file has invalid content
After changing key (I use teeChart V2 so I changed \TeeChartV2.NET key) application didn't report a license compile error, but showed exception that I discribed above. After that I checked both that possibilities discribed by Marc. Everything was ok:
Image
My licenses.licx file contains:

Code: Select all

Steema.TeeChart.TChart, TeeChart, Version=2.0.2306.26232, Culture=neutral, PublicKeyToken=9c8126276c77bdb7
It is the same as licenses.licx file in my second application (that workes fine without licenses.licx and registry key). I even tried simply to copy it to my big progect, delete, add it again and recompile progect, but it still not working. I even have no idea what it can be.

Enother question:
narcis wrote: I'm afraid you'll have to build your projects with the new version of TeeChart.

Do you mean that I should delete all teeChart components from my forms, uninstall old version, then install new version of software, add new components and then start setting all those properties that initially were set in old version of teeChart?
Don't you think it is a difficult and unnecessary routine? Or maybe we have some misunderstanding?
Thank you.

Posted: Tue Jan 16, 2007 12:10 pm
by Marc
Hello,

Re.
"Do you mean that I should delete all teeChart components from my forms, uninstall old version, then install new version of software,"

If you add a new version of TeeChart.dll at the reference location it will automatically be copied to all required locations at compile time.

From the descriptions in this thread at the moment I don't see any obvious cause for the problem.
--------
To summarise general aspects:
- You exe project should included licenses.licx as an embedded resource
- the licenses.licx should contain the following line. The version number will vary according to the version you are using:
Steema.TeeChart.TChart, TeeChart, Version=2.0.2546.16099, Culture=neutral, PublicKeyToken=9c8126276c77bdb7
If in doubt about the contents of this file, delete it from your project (backing up any non-TeeChart component lines) and regenerate it automatically by dragging a TeeChart from the tool palette to a form (you can delete the Chart afterwards if not needed).
- It is not necessary to include the licenses.licx file with the compiled runtime executable application
- The designtime license, as installed by the TeeChart installer or the TeeRegister utility should not be installed to runtime machines.

Regards,
Marc Meumann

Posted: Tue Jan 16, 2007 1:41 pm
by 9641771
I think I found the heart of the problem. I remembered that after compiling my application I renamed it. I renamed it back and it became working.
So am I right and it isn't allowed to rename application after compiling?