PortStatus PortStatus {get;}
PortStatus PortStatus {get;}
/* To append port bindings to IIS Express applicationhost.config file. Supported for Visual Studio 2015 and later 1. Locate applicationhost.config, usually located at [solutionfolder]/.vs/[solution name]/config/applicationhost.config*/ <configuration xmlns:xdt="http://schemas.microsoft.com/XML-Document-Transform"> <system.applicationHost> <sites> <site id="2" xdt:Locator="Match(id)"> <!-- replace id with your site id --> <bindings xdt:Transform="Remove" /> <bindings xdt:Transform="InsertIfMissing"> <binding protocol="http" bindingInformation="*:9328:localhost" /> <!-- repeat this line for every port you would like to bind to your web app --> <binding protocol="http" bindingInformation="*:9329:localhost" /> </bindings> </site> </sites> </system.applicationHost> </configuration>
/*
Open Apache configuration File httpd.conf (on my windows host, it’s located here: “c:\Program Files\Apache Group\Apache2\conf”)
Find the VirtualHost portion for your Website config and Add *:[your port]*/
listen 80
listen 443
listen [your port]
public class Program { public static void Main(string[] args) { CreateHostBuilder(args).Build().Run(); } public static IHostBuilder CreateHostBuilder(string[] args) => Host.CreateDefaultBuilder(args) .ConfigureWebHostDefaults(webBuilder => { webBuilder.UseStartup<Startup>(); webBuilder.UseUrls("http://localhost:5003", "https://localhost:5004"); }); }
/* launchSettings.json provides an easy way to set the application URLs via the applicationUrl property - you can see one under the iisSettings for IIS express , and one under TestApp (the name of the application for this file). See that the application is monitoring https under port 8000 */ { "iisSettings": { "windowsAuthentication": false, "anonymousAuthentication": true, "iisExpress": { "applicationUrl": "http://localhost:38327", "sslPort": 44310 } }, "profiles": { "IIS Express": { "commandName": "IISExpress", "launchBrowser": true, "environmentVariables": { "ASPNETCORE_ENVIRONMENT": "Development" } }, "TestApp": { "commandName": "Project", "launchBrowser": true, "applicationUrl": "https://localhost:5001;http://localhost:5000;https://localhost:8000", "environmentVariables": { "ASPNETCORE_ENVIRONMENT": "Development" } } } }
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2