Upgrade Guide
Last Updated: January 2021
This document provides information about how to upgrade to SnapDevelop 2019 R3.
Upgrading the SnapDevelop IDE
To upgrade the SnapDevelop IDE, simply run the installer of SnapDevelop 2019 R3 and follow the on-screen instructions. For more information about the prerequisites and how to run the installer, refer to the SnapDevelop 2019 R3 Installation Guide.
Upgrading NuGet packages
The 2019 R3 release of SnapDevelop includes new and enhanced APIs for SnapObjects and .NET DataStore. It is recommended to upgrade the following NuGet packages to their latest version:
NuGet Package | Latest Version |
---|---|
.NET DataStore (DWNet.Data and DWNet.Data.AspNetCore) | 3.0.0 |
PowerScript.Bridge | 1.0.3 |
SnapObjects | 3.0.0 |
Upgrading from SnapDevelop 2019
If you upgrade from SnapDevelop 2019, follow the steps below to upgrade the NuGet packages:
Step 1: Re-install NuGet packages.
Upgrade the existing SnapObjects packages to version 3.0.0.
The PowerBuilder.Data packages have been renamed. Remove the following old packages first, and then install the new ones:
Old Package New Package PowerBuilder.Data DWNet.Data PowerBuilder.Data.AspNetCore DWNet.Data.AspNetCore
Step 2: Upgrade .NET DataStore.
Remove the DataWindow SRD files and model files from the project, and then re-generate the data models for DataWindows using the DataWindow Converter tool.
In non-ASP .NET Core project, change the method to load DataWindow from
DataObjectFactory.LoadDataWindow()
toDwModelManager.LoadDwModels()
.If using
DataStore<T>
to replace the original DataStores, you don't need to use theDwModelManager.LoadDwModels()
.Make corresponding changes to DataObject, as now
DataStore.Object
returns anIDwMeta
object, and it is no longer possible to access the DataWindow object properties related with UI (these properties as well as DataObject have been moved to PowerScript.Bridge).
Step 3: Install PowerScript.Bridge.
When using the C# functions which is migrated from PowerScript, or using DataObject which is moved from DWNet.Data to PowerScript.Bridge, you will need to add the PowerScript.Bridge namepspace.
Step 4: Compile the project and modify the script according to the error prompts.
Upgrading ASP.NET Core projects from 2.x to 3.x
To upgrade your ASP.NET Core projects from 2.x to 3.x:
Step 1: Remove the obsolete package references to Microsoft.AspNetCore.App
from the <itemgroup>
section of the .csproj file.
For example, remove the following line from the .csproj file:
<PackageReference Include="Microsoft.AspNetCore.App"/>
Step 2: Update the Program.cs
file.
Remove the
using
statement for the Microsoft.AspNetCore namespace, and add ausing
statement for the Microsoft.Extensions.Hosting namespace.Change
WebHostBuilder
toHostBuilder
.The following snapshot shows the differences between the
Program.cs
file in an ASP.NET Core 2.1 project and the one in an ASP.NET Core 3.1 project:
Step 3: Update the Startup.cs
file.
Replace
IHostingEnvironment
withIWebHostEnvironment
and add ausing
statement for the Microsoft.Extensions.Hosting namespace.In
ConfigureServices
, useservices.AddControllers()
instead ofservices.AddMvc()
, and remove the codeSetCompatibilityVersion(CompatibilityVersion.Version_2_1)
. The following snapshot shows the differences between the differences between theConfigureServices
method from an ASP.NET Core 2.1 project and the one from an ASP.NET Core 3.1 project:Update the
Configure
method.Please note that
UseAuthorization
must appear betweenUseRouting
andUseEndpoints
. The following snapshot shows the differences between theConfigure
method from an ASP.NET Core 2.1 project and the one from an ASP.NET Core 3.1 project:
Step 4: Refer to Migrate from ASP.NET Core 2.2 to 3.0 and Migrate from ASP.NET Core 3.0 to 3.1 for the further changes that your projects might need.