# Conversion Tool

During the migration process each element in the original PowerBuilder application is transformed into its **C#** equivalent, as in the following:

* **Powerbuilder Target** (.pbt) is transformed into a Project Solution file (.sln)
* **PowerBuilder Library** (.pbl) is transformed into a Project file (.csproj)
* **PowerBuilder classes** are each transformed into a separate **class** and also an associated **interface** which is used by WebMAPS's type resolution mechanism.

As shown in the image below; there are two additional projects that are added to the migrated solution: the first one is called **AllInterfaces** and it holds all of a set of interfaces which are related to each PowerBuilder object, and the second one is a **Web Project** which has the same name as the original PowerBuilder target and is used to deploy the web application on a server.

## Migrated solution <a href="#migrated-solution" id="migrated-solution"></a>

A solution is a workspace used to handle multiple projects related to each other. In a migration, the solution contains all of the migrated project libraries used by the original application plus the AllInterfaces and Web Site projects.

## AllInterfaces <a href="#allinterfaces" id="allinterfaces"></a>

In order to replicate the PowerBuilder's library reference handling, a project called "AllInterfaces" is created by the conversion Tool, which contains a set of **Interfaces** related to each class in the original source code, including visual controls, simple classes, structures, etc.

The main purpose of this mechanism is to avoid possible circular references between project libraries. These kinds of references tend to be common in native PowerBuilder code; however they cannot be resolved using traditional .NET library dependency resolution.

The image below shows the dependency project libraries and the interfaces project. Each Library reference has a reference to **AllInterfaces**. Project libraries have no implicit references between themselves since rresolution is handled by the WebMAP's **custom type resolver**.

## Application Projects <a href="#application-projects" id="application-projects"></a>

The application projects are generated directly from the original PowerBuilder Libraries. A C# project is created for each PBL in the source application. Every project contains an equivalent class for the original PowerBuilder object. The object transformation equivalents are the following:

* **Custom** and **Standard** classes and **Structures** are transformed to: a C# class and an interface
* **Custom**, **External** and **Standard** Visuals, **Menus** and **Windows** are transformed to a C# class split into two different files and an interface
* **DataWindows** are transformed into a single C# class.

For some components (mostly visuals) the transformation results into the generation of two class files: One (**class**.cs) containing logic and functionality, and a second (**class**\_Layout.cs) that contains the visual representation of the window.

## Application Site Project <a href="#application-site-project" id="application-site-project"></a>

This project is a standard **ASP.NET Core Web Application** project that is used as the entry point for the migrated solution. It also serves as a container for all of the project libraries in order to solve the original libraries' references as shown in the image below.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.gapvelocity.ai/webmap/powerbuilder-to-.net/getting-started/convertion-tool.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
