IHostBuilder not working while IWebHostBuilder in Linux in aspnet core 3.1 web api application
See original GitHub issueI have .net core web api project. I am running my application in both Windows and Linux
Problem is My application get starts and works in both linux and windows with IWebHostBuilder while equivalent(what i think so) code for using IHostBuilder didn’t start my application in linux.
Please somebody give idea what wrong i am doing
Following currently works
public static IWebHostBuilder BuildWebHost(string[] args) => WebHost.CreateDefaultBuilder(args).
ConfigureKestrel(serverOptions =>
{
}).UseIISIntegration()
.UseStartup<StartupShutdownHandler>();
Following doesn’t works in linux but works in windows
public static IHostBuilder CreateHostBuilder(string[] args) =>
Host.CreateDefaultBuilder(args)
.ConfigureWebHostDefaults(webBuilder => webBuilder.UseKestrel().UseIIS().UseStartup<StartupShutdownHandler>());
I have to run my app on both windows and linux
Issue Analytics
- State:
- Created 3 years ago
- Comments:7 (3 by maintainers)
Top Results From Across the Web
IHostBuilder not working while IWebHostBuilder in Linux in ...
Problem is My application get starts and works in both linux and windows with IWebHostBuilder while equivalent(what i think so) code for using ......
Read more >ASP.NET Core Web Host
The host is responsible for app startup and lifetime management. At a minimum, the host configures a server and a request processing pipeline....
Read more >NET Generic Host in ASP.NET Core
Use .NET Core Generic Host in ASP.NET Core apps. Generic Host is responsible for app startup and lifetime management.
Read more >NET Core 2.2 -> 3.1 API - App Builds but stuck loading
I am, I did just find that I was using IWebHostBuilder in my Program.cs, while a new project uses IHostBuilder, by updating this...
Read more >5 ways to set the URLs for an ASP.NET Core app
In this post I describe 5 different ways to set which URLs your ASP.NET Core application listens on.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
“server.urls” is considered obsolete and replaced by “urls”. We transitioned to “urls” quite a while ago, but I don’t see the associated annoucement. WebHost checked both for backcompat. https://github.com/dotnet/aspnetcore/blob/d4a2fa1ceb3b9c10054da8a7c6a4bd61801aea18/src/Hosting/Hosting/src/Internal/WebHost.cs#L303 GenericHost does not. https://github.com/dotnet/aspnetcore/blob/e3d3da3546aa2085aa39520f3c302d0672e5bab8/src/Hosting/Hosting/src/GenericHost/GenericWebHostedService.cs#L71
Your are correct. looks like we were using some initial way assigning service which isn’t available even in documents. I will try to update this in my service. Any way thanks for this precious information. Will try to edit my service file tomorrow and run it