Using ASP.NET in a lesson

By default, ASP.NET does not allow applications to be accessed remotely. This means that the in-lesson web browser will not be able to access the application, as it is technically running outside of the sandbox environment.

To address this, add a UseUrls statement, as shown below:

public static IWebHost BuildWebHost(string[] args) =>
WebHost.CreateDefaultBuilder(args)
.UseUrls("http://*:5000")
.UseStartup<Startup>()
.Build();
}

You can then use dotnet run to start your application.