SftTree/NET 3.0 is source code compatible with SftTree/NET 2.0. An application is upgraded by replacing its SftTree/NET 2.0 assembly references with a reference to the SftTree/NET 3.0 assembly and rebuilding it; the application code does not change. Forms designed with SftTree/NET 2.0 and documents saved by SftTree/NET 2.0 load unchanged. This topic describes the upgrade of a .NET Framework application step by step and what an upgraded application may notice at run time.
Before upgrading, make sure the projects are under source control or backed up. Once a form or a document has been saved with SftTree/NET 3.0, it can no longer be opened with SftTree/NET 2.0.
SftTree/NET 3.0 installs side by side with SftTree/NET 2.0, so applications can be upgraded one at a time:
One application cannot use both versions: they use the same namespaces and type names, so a project references either SftTree/NET 2.0 or SftTree/NET 3.0.
If the project targets a .NET Framework version older than 4.7, change its target framework to .NET Framework 4.7 or later in the project properties.
In Solution Explorer, expand References and remove the references Softelvdm.Controls and Softelvdm.SftTreeNET. Then add a reference to the SftTree/NET 3.0 assembly: in the Reference Manager, select Assemblies > Extensions and check Softelvdm.SftTreeNET, version 3.0.0.0, or click Browse and select \Program Files (x86)\Softelvdm\SftTree NET 3.0\Bin\Softelvdm.SftTreeNET.dll.
In the project file (.csproj, .vbproj), the two SftTree/NET 2.0 references
<Reference Include="Softelvdm.Controls, Version=1.0.0.0, Culture=neutral, PublicKeyToken=25c3069afccab10e, processorArchitecture=MSIL"> ... </Reference> <Reference Include="Softelvdm.SftTreeNET, Version=2.0.21.0, Culture=neutral, PublicKeyToken=25c3069afccab10e, processorArchitecture=MSIL"> ... </Reference>
(the version depends on the SftTree/NET 2.0 release used) become one reference to SftTree/NET 3.0, for example:
<Reference Include="Softelvdm.SftTreeNET, Version=3.0.0.0, Culture=neutral, PublicKeyToken=25c3069afccab10e, processorArchitecture=MSIL"> <SpecificVersion>False</SpecificVersion> <HintPath>C:\Program Files (x86)\Softelvdm\SftTree NET 3.0\Bin\Softelvdm.SftTreeNET.dll</HintPath> </Reference>
The using directives (C#) and Imports statements (Visual Basic) for the namespaces Softelvdm.SftTreeNET and Softelvdm.Controls stay as they are. Both namespaces are now in the one assembly Softelvdm.SftTreeNET, so the Softelvdm.Controls reference is no longer needed.
Rebuild the project. SftTree/NET 2.0 code compiles unchanged, with one exception: the parameter of HeadersClass.RemoveAt and FootersClass.RemoveAt, a row index, is named RowIndex (SftTree/NET 2.0: ColIndex). Code that passes it as a named argument must use the new name.
Forms designed with SftTree/NET 2.0 need no changes. The tree contents (items, headers and footers) saved in the form's .resx file load unchanged, in the designer and at run time, and the form's design-time license information stays valid for the distributed application. When a form is saved in the designer, its tree contents are written by SftTree/NET 3.0 and the form can no longer be opened with SftTree/NET 2.0.
Ship the SftTree/NET 3.0 assembly Softelvdm.SftTreeNET.dll from \Program Files (x86)\Softelvdm\SftTree NET 3.0\Redist\ with the application, in place of the SftTree/NET 2.0 files Softelvdm.SftTreeNET.dll and Softelvdm.Controls.dll. The publisher policy assemblies Policy.2.0.Softelvdm.SftTreeNET.dll and Policy.1.0.Softelvdm.Controls.dll and their .config files, if the application's setup installed them, are no longer needed. See Distributing SftTree/NET.
Documents saved by a SftTree/NET 2.0 application with GetContents load with SetContents in a SftTree/NET 3.0 application for the .NET Framework, including their images and fonts. Documents saved by SftTree/NET 3.0 cannot be loaded by SftTree/NET 2.0.
An upgraded application looks and behaves as before. The new features are off by default: DarkMode and HighContrastMode are Off, ImageScaling and PixelScaling are AsIs, and per-monitor DPI awareness applies only to applications that declare it. Screen readers are supported without any change to the application. For the new features, see New Features.
Differences from SftTree/NET 2.0 that an upgraded application may notice: