-
Notifications
You must be signed in to change notification settings - Fork 10.5k
Closed
dotnet/docs
#37661Labels
area-networkingIncludes servers, yarp, json patch, bedrock, websockets, http client factory, and http abstractionsIncludes servers, yarp, json patch, bedrock, websockets, http client factory, and http abstractions
Description
Is there an existing issue for this?
- I have searched the existing issues
Describe the bug
The .NET images for .NET 8 changed from using ASPNETCORE_URLS
to using ASPNETCORE_HTTP_PORTS
.
Older applications using the WebHost
API don't seem to pick up the new environment variable.
Expected Behavior
Applications using the WebHost
API should use the new environment variables.
Or this should be documented as a breaking change.
Steps To Reproduce
using Microsoft.AspNetCore ;
public class Program
{
public static void Main(string[] args)
{
CreateWebHostBuilder(args).Build().Run();
}
public static IWebHostBuilder CreateWebHostBuilder(string[] args) =>
WebHost.CreateDefaultBuilder(args)
.UseStartup<Startup>();
}
class Startup
{
public void Configure()
{ }
}
$ ASPNETCORE_HTTP_PORTS=8080 dotnet run --no-launch-profile
Hosting environment: Production
Content root path: /tmp/web2
Now listening on: http://localhost:5000
Application started. Press Ctrl+C to shut down.
As shown in the output, the application binds to port 5000 instead of port 8080 as set by the envvar.
Exceptions (if any)
No response
.NET Version
8.0.100-rc.1.23455.1
Anything else?
No response
Metadata
Metadata
Assignees
Labels
area-networkingIncludes servers, yarp, json patch, bedrock, websockets, http client factory, and http abstractionsIncludes servers, yarp, json patch, bedrock, websockets, http client factory, and http abstractions