Upgrading PowerServer projects – PB Docs 2022

Upgrading PowerServer projects

Due to changes made to the PowerServer project settings and the
PowerServer Web APIs, the PowerServer C# solution created in version
2021 will have to be upgraded first before it can work with version
2022. You will either have to

  • Generate a brand new PowerServer C# solution (in Version
    2022)

    This new solution will be generated with the latest
    changes/templates. However, if you have made your own changes to the
    solution before, you will need to manually incorporate those changes
    to the new solution.

  • Or, use the existing PowerServer C# solution

    This can keep your own changes in the solution. However, the
    solution will still use the settings/templates of Version 2021 even
    if you use Build & Deploy PowerServer
    Project
    in PowerBuilder IDE at Version 2022 to build the
    solution again; unless you manually change the following areas in
    the solution (to be in sync with the settings/templates of Version
    2022):

    1. Upgrade PowerServer.Core
      and PowerServer.Api to the
      latest compatible version 2.0.0. Or refer to this
      table
      for a list of NuGet packages compatible with the
      application deployed via PowerServer Toolkit from different
      builds.

      If you don’t manually upgrade PowerServer.Core and PowerServer.Api, you will encounter the
      error “Application Terminated. The communication
      protocol is inconsistent between the server and the
      client
      ” (view
      more
      ) when running the installable cloud app.

      upgrade_1.png

    2. Add the following scripts to the PowerServer C# solution
      > ServerAPIs project >
      Startup.cs:

      upgrade_2.png

      upgrade_3.png

      upgrade_4.png

    3. Add the following script to the PowerServer C# solution
      > ServerAPIs project >
      Server.json:

      “PathBase” is used to specify the sub-folder of the Web
      site where PowerServer Web APIs is deployed, for example,
      “/vpath1”.

      Note

      A value is required only if you have specified a
      sub-folder of the Web site in the Web API URL (for example,
      http://172.168.168.88:5000/vpath1).

      You can set it to null if no sub-folder is used.

      upgrade_5.png

    4. Add the following script to the PowerServer C# solution
      > ServerAPIs project >
      OpenAPI > OpenAPIExtensions.cs:

      This will add the route prefix “PowerServer” to the
      PowerServer Swagger UI, so that Swagger UI can start
      successfully.

    5. Add the following script to the PowerServer C# solution
      > ServerAPIs project >
      Logging > Logging.json or Logging.Development.json if you want to
      specify log level for logging providers such as Microsoft,
      Microsoft.Hosting.Lifetime, and
      System.Net.Http.HttpClient.PowerServer:

    6. Add the following script to the PowerServer C# solution
      > ServerAPIs project >
      Server.json if you want to keep
      the version information:

PowerBuilder installable cloud apps deployed in Version 2021 will
have to be re-deployed in Version 2022 by following steps below:

  1. Select Tools > System Options in the PowerBuilder IDE; make
    sure the correct runtime version is selected on the General tab. If you are not sure which
    version is correct, refer to Selecting
    a version of PowerBuilder Runtime
    .

  2. Select the required database types and agree to the license
    terms of the database drivers that will be downloaded.

    To do that, open the PowerServer project painter in the
    PowerBuilder IDE, select the Database page, select the database type from
    the Provider list box, and then
    select the check box of “I have read and agree to the license
    terms…”.

  3. Make sure the deployment mode is Full.

    To do that, open the PowerServer project painter in the
    PowerBuilder IDE, select the Client
    App
    page, select Full in
    Project build options.

  4. Deploy the application again using the Build & Deploy PowerServer Project option
    in the PowerBuilder IDE.

    Or, export the JSON build file again and then re-deploy the
    application using PBAutoBuild. For
    how to export the build file and deploy with PBAutoBuild, see Build
    & deploy using commands
    .

  5. Upload the Cloud App Launcher and Runtime files to the server.
    For detailed instructions, refer to Upload
    the cloud app launcher and the runtime files
    .


Document get from Powerbuilder help
Thank you for watching.
Was this article helpful?
Subscribe
Notify of
guest
0 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x