question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Update code and docs for generic hosting upcoming changes

See original GitHub issue

Pull request aspnet/Hosting#1580 includes changes to how hosting works to support a generic host builder on which web host builder is layered. Some of these changes are breaking and we’ll need to adjust docs, examples, and code to support it.

  • Adding an IServiceProviderFactory as a service no longer works. Call IHostBuilder.UseServiceProviderFactory instead. This changes the samples and renders the ServiceCollectionExtensions.AddAutofac method obsolete.
  • You can no longer return an IServiceProvider from Startup.ConfigureServices. You must use the IServiceProviderFactory and ConfigureContainer. This will affect the use case where folks intentionally want to keep a reference to the built container or use a child lifetime scope as the pseudo-root of the app. I’ve mentioned that in a comment on the PR. You may need a custom service provider factory for this, but you can capture the factory instance during Configure.

In general it appears that while the new pattern moves toward a more generic hosting mechanism, it moves away from the notion of having composite application types (e.g., a self-hosted ASP.NET Core app and a background service all in one logical process).

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:25 (20 by maintainers)

github_iconTop GitHub Comments

2reactions
tilligcommented, Aug 29, 2019

Docs are adjusted and an RC package just went out. This will be the 5.0.0 release when it’s finalized, but we’ll wait on that final release until after .NET Core 3 itself is released.

2reactions
tilligcommented, Aug 29, 2019

I will likely release a beta package shortly. Also, don’t forget there’s a MyGet feed for early adopters where you can pick up and use any of our CI builds: https://www.myget.org/F/autofac/

Read more comments on GitHub >

github_iconTop Results From Across the Web

NET Generic Host
Learn about the .NET Generic Host, which is responsible for app startup and lifetime management.
Read more >
Migrate from ASP.NET Core 5.0 to 6.0
Detailed examples of migrating ASP.NET Core 5 Startup code to ASP.NET Core 6 using the minimal hosting model are provided later in this...
Read more >
NServiceBus Host Upgrade Version 7 to 8
The NServiceBus Host will be deprecated as of version 9; it is recommended to switch to self-hosting or the generic host for new...
Read more >
Latest Google Search Documentation Updates
This page details the latest major updates made to the Google Search Central ... April 20: Added a new generic crawler, GoogleOther ,...
Read more >
Releases | GitLab
You can use Generic packages to host your release assets. For a complete example, see the Release assets as Generic packages project.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found