How to Setup WebMap Applications To Run Over SubDomains or WebApplications In IIS

This post explains how to setup WebMap migrated applications to run over SubDomains or WebApplications In IIS WebSever, Steps apply for migrated applications with Backend project in Visual Studio

Setup will work for next versions of package components or higher:

  • 7.3.1 WFNetKendoComponents

  • 7.3.58 PBKendoComponents

  • 0.1.1-rc.1343 WFNetC1Components

  • 2.2.0-rc1265 WFNetJanusKendoComponents

  • 1.23.5 WebFormsComponents

Before performing that configuration please be sure project has last version of Mobilize package. You will be able to see last version of Mobilize components used in package.json file in angular frontend project dependencies object. Mobilize reference packages can change based in the kind of technology used for migration. For example winforms-components correspond to packages used to migrate WinForms legacy applications created in Visual Studio .Net.

Go to app.module.ts file and try to find "const config" object declaration.

If object config is already declared add line baseHref: '/SubDomainName/' as a new object property and replace word SubDomainName by the nameof the subdomain or web application configured in IIS.

For example: in bellow image as the subdomain was created with DropDown you should replace SubDomainName with DropDown baseHref: '/DropDown /'

In case config object doesn’t appear declared in file, you must include object config definition after import section and before @NgModule and follow some extra steps explained bellow to achieve setup correctly.

const config: any = { dataManagerBusyLoaderTime: 0, useBundleEvent: false, useDynamicServerEvents: true, usePercentage: false, webMapVersion: 'v5', showBrowserContextMenu: false, baseHref: '/DropDownList2/', };

After last step go to app.compoment.html file and try to find wm-background-worker if the label exists modify url property in background-worker to include name of subdomain.

Then go to terminal and execute next command to build frontend angular project ng build --base-href “/DropDownList2/” –prod where “/DropDownList2/” should be replaced by the name of the subdomain created in IIS and where you will publish WebMap migrated application.

Finally go to backend project in Visual Studio and publish site. Then move published files to physical path setup for web application.

If you go to network, you will see all requests should include additional subdomain in Request URL. and application should work properly when is under a subdomain.

Last updated