The PowerServer C# solution is generated when you build the PowerServer project in the IDE. It is an ASP.NET Core solution which can be opened in a C# editor such as SnapDevelop, Visual Studio, etc.
The PowerServer C# solution contains the following projects:
-
The AppModels project (①) contains the C# models (converted from the PowerBuilder DataWindows/DataStores) and the embedded SQLs (ESQL) from the PowerBuilder application. They will be automatically exposed via REST/JSON APIs.
-
The ServerAPIs project (②) contains the RESTFul APIs for handling the database connections, data processing, PowerServer license activation etc.
Note
The ServerAPIs project also includes a "wwwroot" sub-folder where the static files such as the cloud app launcher, runtime files and the application files are deployed with the Web APIs by default.
-
The ServerAPIs.Tests project (③) contains a number of test cases which can check if the RESTFul APIs is running correctly after the ServerAPIs project is modified manually.
-
The UserExtensions project (④) contains miscellaneous tools such as logging, authentication, management APIs etc. And as the project name suggests, you can also customize and enhance this project by adding additional code and functionalities in this project, and they will remain unchanged and unaffected even when the solution is upgraded.
The AppModels and ServerAPIs.Tests projects should NOT be modified after generation. Only the UserExtensions project and a few settings in the ServerAPIs project can be modified. Refer to What settings can be modified in the solution for more details.
The PowerServer C# solution needs to download the following NuGet packages: PowerServer.Core, PowerServer.API (read more), and the corresponding data provider for .NET Core.
You can compile and run the ServerAPIs project in a C# editor or directly run the compiled ServerAPIs.exe file to start the PowerServer Web APIs.
New solution vs. existing solution
Depending on whether multiple applications will use the same PowerServer or each application will use its own PowerServer, you can choose to create a new PowerServer C# solution or use an existing solution. If you want one PowerServer to be used by all applications, you can choose an existing solution; and then deploy the app (as well as the others) to this solution. If you re-deploy an app to an existing solution, the application data models and ESQLs will get updated in the solution, and if you deploy a new app to an existing solution, the application data models and ESQLs will be added to the existing solution. Apps deployed to the same solution can share settings such as the PowerServer license, Web APIs, database configurations etc. and can take advantage of new developments added by the user such as authorization etc.
If you plan to host the PowerServer (in a docker container, for example) on the cloud server, and want to use one PowerServer for all applications, you can select an existing solution and deploy the applications to the same solution.
If you plan to host the PowerServer in the IIS server, as IIS allows you to create multiple websites in a single server, you can host the PowerServer on its own dedicated website, and each application has its own dedicated PowerServer. This means, if you have more than one application, each application and each PowerServer can be hosted on its own dedicated website. In this case, you can select to create a new solution for each application.
For configuring the solution for the PowerServer project, refer to Configure the solution basics for details.