-
Notifications
You must be signed in to change notification settings - Fork 25.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update Kestrel startup sample code with file descriptor for 3.0 #13744
Comments
Hello ... We aren't able to provide product support. Your best option is to consult with devs on a support forum, such as Stack Overflow, or a support chat, such as Slack or Gitter. If you think that you found a framework bug, open an issue on the engineering repo. |
Actually, this more of a @tdykstra thing. I'll note in passing that AFAIK we have all of the Anywho ---- this is more of a @tdykstra area of the TOC, so I defer to my friend on this one. |
Closing because it's a duplicate of #12842 |
@coderfox, you're using custom code that generates that error, correct? ... i.e., this isn't an OOB template app, correct? |
@guardrex I can't quite catch up with the meaning of In your sample code, there are multiple sections of starting the application and bind to a socket, and I am just using the section of binding to existing file descriptors by defining |
@coderfox Try the following and see if it runs ... Project File<Project Sdk="Microsoft.NET.Sdk.Web">
<PropertyGroup>
<TargetFramework>netcoreapp3.0</TargetFramework>
</PropertyGroup>
</Project> Program.csusing System;
using Microsoft.AspNetCore.Hosting;
using Microsoft.Extensions.Hosting;
namespace KestrelSample
{
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.ConfigureKestrel(serverOptions =>
{
var fds = Environment
.GetEnvironmentVariable("SD_LISTEN_FDS_START");
var fd = ulong.Parse(fds);
serverOptions.ListenHandle(fd);
serverOptions.ListenHandle(fd, listenOptions =>
{
listenOptions.UseHttps("testCert.pfx", "testpassword");
});
})
.UseStartup<Startup>();
});
}
} |
@guardrex No. Exactly the same exception is thrown. |
MOVED TO #12842 (comment) |
Issue description
The sample code provided in
AspNetCore.Docs/aspnetcore/fundamentals/servers/kestrel/samples/2.x/KestrelSample/Program.cs
fails to start up whenFileDescriptor
defined on Dotnet Core 3.0 preview.The command line outputs:
Software versions
Check the .NET target framework(s) being used, and include the version number(s).
netcoreapp3.0
If using the .NET Core SDK, include
dotnet --info
output. If using .NET Framework without the .NET Core SDK, include info from Visual Studio's Help > About Microsoft Visual Studio dialog.dotnet --info output or About VS info
The text was updated successfully, but these errors were encountered: