New Port number not reflected in app.Port

If I build a WebApp to be viewed using port 80 (the default) then app.Port is set to 80 and the WebApp is visible on port 80, as per expectation.

If I run the same app from the Terminal (Mac, Windows and Linux act the same) with the postfix ‘–port=9999’ the WebApp is visible on port 9999 and not port 80 — but inside the WebApp app.Port still shows as 80 and not 9999. Is there a way to fix this, or is there another variable that shows the new 9999 port number.

If this is a bug then tell me so I can create a feedback report.

Hi David… One workaround is to parse system.commandline for the --port= value

Thanks Chris, I was hoping to not have to do that!

[quote=185089:@David Cox]If I build a WebApp to be viewed using port 80 (the default) then app.Port is set to 80 and the WebApp is visible on port 80, as per expectation.

If I run the same app from the Terminal (Mac, Windows and Linux act the same) with the postfix ‘–port=9999’ the WebApp is visible on port 9999 and not port 80 — but inside the WebApp app.Port still shows as 80 and not 9999. Is there a way to fix this, or is there another variable that shows the new 9999 port number.

If this is a bug then tell me so I can create a feedback report.[/quote]
Where are you looking at app.port?

In the ‘Run’ Event of a Console application.

There is no Run event in the WebApplication class.

Ok. So I’ve isolated this as a regression and have created a case for it:

<https://xojo.com/issue/39237>

Sorry Greg, you’re right, I meant ‘Open’ — I swap between WebApps, Console Apps and ServiceApps.