|
|
|
|
|
by useerup
1563 days ago
|
|
1. Create a new web project (it is actually a console app) 2. In program.cs add the following lines at the top: Console.Write("Port number:");
var port = int.Parse(Console.ReadLine());
3. Change the bottom line App.Run()` to app.Run($"https://localhost:{port}");
You now have an application which asks for a port and launches your empty website on that port.A `Microsoft.NET.Sdk.Web` project is still a console app. The "web" variant has some other default packages and (crucially) it has some other defaults for how to compile files such as cshtml. |
|