Skip to main content

Updating from older version

LightningChart components API may have been changed from an older version, after which the project may not load or use the new version automatically. These instructions show how to set the new version assemblies as a reference to a project and how to fix the properties that were unable to de-serialize in the Visual Studio form editor.

In order to update chart, the reference to the old version has to be removed and a reference to the new version added. In some cases *.Designer.cs and *.resx files may need to be fixed as they may contain properties, which are binary incompatible.

Removing the old reference from project References
  1. Go to Solution Explorer.
  2. Open References folder.
  3. Select LightningChart assemblies and remove them by pressing Delete key or right-click and select Remove.


Adding a reference to a new version
  1. Go to Solution Explorer.
  2. Open References folder.
  3. Add reference to new chart. Right-click on References folder. Select Add Reference... and select the new LightningChart DLL file.


As the API may have been changed, the source code on changed properties may have to be fixed.
If a chart is totally incompatible (i.e. Visual Studio can't load UI on form editor), LightningChart property setters have to be removed from *.Designer.cs and *.resx files.

Removing property setters from *.Designer.cs file
  1. Open *.Designer.cs file in text editor (use other editor than Visual Studio if possible).
  2. Locate and delete rows containing setters for LightningChart. For example: this.m_chart.Background = ((LightningChartLib.WPF.Charting.LightningChart.Fill)(resources.GetObject("m_chart.Background")));

There is no need to remove inherited properties, like Location and Size. Remove properties, which are read from resource by a method like above "NN = ((...)(resources.GetObject("...")));".



Removing serialized items from *.resx file
  1. Open *.resx file in text editor.
  2. Find xml tags containing LightningChart objects (they are identified with chart member name. e.g. "m_chart" or "LightningChart1").
  3. Remove the lines including tag to the end of xml object ( tag). E.g. if chart background is serialized as the following xml object, all the following lines should be removed from the *.resx file:
<data name="m_chart.Background" mimetype="application/x-microsoft.net.object.binary.base64">
<value>
AAEAAAD/////AQAAAAAAAAAMAgAAAGRBcmN0aW9uLkxpZ2h0bmluZ0NoYXJ0VWx0aW1hdGUsIFZlcnNp b249NC42LjEuMjAwMSwgQ3VsdHVyZT1uZXV0cmFsLCBQdWJsaWNLZXlUb2tlbj03MmY1NWZiZDY5MDFm
... lots of encoded stuff ...
YXlvdXQBAAAAB3ZhbHVlX18ACAIAAAAAAAAACw==
</value>
</data>
note

Note that some objects may be very large, e.g. title row count may be approximately 200 lines while views are usually much larger (View3D has about 2000 lines).

In case of having several charts, all their serialized properties need to be removed. Editor search is a handy tool to find the chart objects.

After the objects are removed from *.resx file and related setters from *.Designer.cs file, it should be possible to open the project successfully in Visual Studio form editor.