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.

Microsoft.Extensions.Hosting 2.2 fails to use Microsoft.Extensions.Hosting.Abstractions 3.0

See original GitHub issue

Describe the bug

While this does seem obvious that version 2.2 of Microsoft.Extensions.Hosting will not work with 3.0 of Microsoft.Extensions.Hosting.Abstractions The nuget package published https://www.nuget.org/packages/Microsoft.Extensions.Hosting/ says it will take ANY version equal or higher than 2.2.

https://www.nuget.org/packages/Microsoft.AspNetCore.App/ will NOT take version 3.0 however.

So if you take a dependency on https://www.nuget.org/packages/Microsoft.AspNetCore.App/ and obey the version specifications…it would appear that:

https://www.nuget.org/packages/Microsoft.AspNetCore.App/ - 2.2.7 https://www.nuget.org/packages/Microsoft.Extensions.Hosting/ - 2.2 https://www.nuget.org/packages/Microsoft.Extensions.Hosting.Abstractions/ - 3.0

Are all completely compatible…but i don’t believe they are.

I get an error stating Unhandled Exception: System.TypeLoadException: Method 'UseServiceProviderFactory' in type 'Microsoft.Extensions.Hosting.HostBuilder' from assembly 'Microsoft.Extensions.Hosting, Version=2.2.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60' does not have an implementation.

i am using paket for dependency management here not the standard nuget clients.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:9 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
forkicommented, Sep 26, 2019

Unfortunately nuget.org does not allow to change version ranges after a package was released. So not much that can be done about it. In paket we will add a new mode which will be a bit more conservative, but MS could also try to be more forward looking in their range definitions. I mean its almost certain that next major will be breaking. This will break max resolution again. In nuget and Paket.

0reactions
DamianEdwardscommented, Oct 1, 2019

We’ve attempted using ranges before and unfortunately without a crystal ball or time machine it’s impossible for us to get right ahead of time, and each time we attempted to we simply blocked otherwise compatible packages from being used together and thus causing lots more people pain than if we’d just left them off, as by far most people appreciate and understand that it’s best to keep related packages on the same aligned version.

Retroactively adding ranges once we know there is a break in a given API is (by the .NET Core policy definition) a servicing event, due to the fact that @forki pointed out. We’d have to ship a patch to the package to update the range. We simply haven’t seen enough cases of this being a big issue to warrant that given the number of packages we ship as part of .NET Core (literally hundreds) and the effort that would be required to ensure they always reflect their upper bounds of compatibility.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Microsoft.Extensions.Hosting 2.2 fails to use ...
Describe the bug While this does seem obvious that version 2.2 of Microsoft.Extensions.Hosting will not work with 3.0 of Microsoft.
Read more >
I'm getting the error "Microsoft.AspNetCore.Hosting. ...
It looks like I have both "Microsoft.AspNetCore.Hosting.Abstractions" and "Microsoft.Extensions.Hosting.Abstractions", referenced in my projects ...
Read more >
Migrate from ASP.NET Core 2.2 to 3.0
Learn how to migrate an ASP.NET Core 2.2 project to ASP.NET Core 3.0.
Read more >
Breaking changes in .NET Core 3.0
NET Core 2.2 project. The EnableRewind extension method exists in the Microsoft.AspNetCore.Http.Internal namespace.
Read more >
NETSDK1079: The Microsoft.AspNetCore.All package is ...
NET Core project from .NET Core 2.2 or earlier to .NET Core 3.0 or later. The project uses the Microsoft.AspNetCore.All package.
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