Web Forms Deployment

When a .NET Web Forms project is open in the Project painter and no other painters are open, you can select Design > Deploy Project from the Project painter to deploy the project.

When all painters are closed, including the Project painter, you can right-click a Web Forms project in the System Tree and select Deploy from its context menu.

The Output window shows the progress of the deployment and provides a list of application functions, events, and properties that are not supported in the Web Forms version of the application. Most of these warnings are benign and do not prevent users from running the application as Web Forms.

If a supported version of the Microsoft .NET Framework is the only version of the .NET Framework installed on the server, or if you configured the server to use a supported version (2.0, 3.0, or 3.5) for all Web sites by default, you can run the application immediately after you deploy it.

You can run the application from PowerBuilder by selecting Design > Run Project from the Project painter menu or selecting the Run Project toolbar icon from the Project painter toolbar. The System Tree context menu for the Web Forms project also has a Run Project menu item.

Deployment to a setup file

If you are deploying a .NET project to an MSI file, you must have a file named License.rtf in the PowerBuilder DotNET\bin directory. The PowerBuilder setup program installs a dummy License.rtf file in this directory, but you should modify this file’s contents or replace the file with another file of the same name.

The License.rtf file should contain any license information you want to distribute with your application. You can run the .NET application only after the setup file is extracted to an IIS server. The contents of the License.rtf file appear in the setup file extraction wizard.

After you create and distribute the MSI file to an IIS server, you must extract the MSI file on the server. By default the extraction directory is set to C:\Program Files\Webform\applicationName, and the extraction wizard creates the C:\Program Files\Webform\applicationName\applicationName and C:\Program Files\Webform\applicationName\applicationName_root virtual directories, where applicationName is the name of your application.

Although you do not need to modify the default extraction directory to run the application, the extraction wizard does let you change the location of the application directories you extract. If you prefer to keep all your applications directly under the server’s virtual root, you could set the extraction directory to server’s Inetpub\wwwroot directory.

Deployment to a production server

You can deploy a Web Forms application to a production server either by:
  • Extracting an MSI file that you build from a Web Forms project
  • Deploying directly from the development computer to a mapped server
  • Copying all application folders and files from IIS on a local server to IIS on a production server

Production servers must meet the requirements described in ASP.NET Configuration for a .NET Project. You must install all database clients and have access to all data sources on the production computer. For applications that you deploy to a production server, you should add required database driver DLLs to the Win32 dynamic library list on the Library Files tab page of your Web Forms projects. If you are using ODBC to connect to a database, you should add the PBODB125.INI file to the list of resource files on the Resource Files tab page of Web Forms projects.

The production server must have the following DLLs in its system path: atl71.dll, msvcr71.dll, msvcp71.dll, msvcp100.dll, msvcr100.dll, pbshr125.dll, and if your application uses DataWindow objects, pbdwm125.dll. You can also use the Runtime Packager to deploy required PowerBuilder runtime files to the ASP.NET server. After you install the package created by the Runtime Packager, you must restart the server.

For a complete list of required runtime files and for information on the Runtime Packager, see Application Techniques > Deploying Applications and Components.

Deployment to a remote server

You can deploy directly to a mapped server only if the server is in the same domain or workgroup as the development computer. In addition, you must add the development computer user’s Windows login ID as a member of the Administrators group on the remote computer hosting the IIS server.

If you copy a Web Forms application from a development computer to a production server, you must copy both the applicationName and applicationName_root folders (and their contents) that were created when you deployed the application locally. Direct deployment to a mapped server automatically adds the necessary ASP.NET user permissions to access these directories, but if you copy files to the server, you must add these permissions manually.

Note: For information on the directory file structure of a deployed Web Forms application under the IIS virtual root directory (\inetpub\wwwroot), see Web Forms File Manager.

ASP .NET user permissions

If you copy files to a production server, or extract your Web Forms application from an MSI file, you can use Windows Explorer to grant ASP.NET permissions to the application directories. This method is described in Setting Up a SQL Anywhere Database Connection. You can also grant ASP.NET permissions from a command line. The commands are different depending on the version of IIS that your server is running:
IIS version Commands for granting appropriate user permissions
5
cacls applicationName\temp /t /e /c /g ASPNET:f
cacls applicationName_root /t /e /c /g ASPNET:f
6
cacls applicationName\temp /t /e /c /g IIS_WPG:f
cacls applicationName_root /t /e /c /g IIS_WPG:f
7 and 7.5
cacls applicationName\temp /t /e /c /g IIS_IUSRS:f
cacls applicationName_root /t /e /c /g IIS_IUSRS:f

Event logging on the production server

If you log Web Forms application events to a production server’s event log (by setting the PBTraceTarget global property to "EventLog"), you must have a registry entry key for PBExceptionTrace. If you use an MSI file to deploy an application to a production server, the PBExceptionTrace key is created automatically. If you deploy directly to a mapped production server or if you copy a Web Forms application to a production server, you must import the PBExceptionTrace key or create it manually.

When you deploy to a local computer, PowerBuilder creates the following key: HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Eventlog\Application\PBExceptionTrace. You can export this key to a .REG file and import it to the production server’s registry.

For information on the PBTraceTarget global property, see Global Web Configuration Properties.

If your Web Forms application uses any ActiveX DLLs, such as HTML2RTF.DLL or RTF2HTML.DLL, you must also register these files on the production server.

Running the project

When you debug or run the project from PowerBuilder, a system option setting can cause a message box to appear if the application has been modified since it was last deployed. The message box prompts you to redeploy the application, although you can select No to debug or run the older application, and you can set the system option to prevent the message box from appearing.

For information about the message box, see Triggering Build and Deploy Operations. For information about the system option, see System Option.

The Web browser that opens when you run a Web Forms project from PowerBuilder does not include the browser menu and toolbar. This is because PowerBuilder does not append the starting page, default.aspx, to the URL listed in the project. You can see the application in a browser window that includes the browser menu and toolbar by typing the URL in the browser location window or address bar. The URL address is not case-sensitive.

Note: If your application requires command line parameters, you can assign values to the PBCommandParm global property before you deploy the application. For information on setting global properties, see Global Web Configuration Properties.
Application users can override the PBCommandParm parameter set at design time by adding it at the end of the application’s URL, preceded by a question mark. Multiple parameters are separated by the ASCII character code for an empty space (%20). For example, the following address, entered on a single line, uses two start-up parameters for the mypbapp Web Forms application deployed to the www.mysite.com Web site:
http://www.mysite.com/mypbapp/default.aspx?PBCommandParm=p1%20p2

If you do not include the starting page, default.aspx, in a URL that you type in a browser address bar, or if you append default.htm as the starting page, IIS still redirects you to the default.aspx page, but the browser menu and toolbar do not display.