When trying to update the NuGet packages for my solution, I get the following error: Unable to resolve dependencies. 'Microsoft.Extensions.DependencyInjection 2.0.0' is not compatible with 'Microsoft.AspNet.OData 6.1.0 constraint: Microsoft.Extensions.DependencyInjection (>= 1.0.0 && < 2.0.0)'.
Microsoft.AspNet.OData 6.1.0
Create a solution which uses Microsoft.AspNet.OData 6.0.0. Then attempt to update to version 6.1.0.
NuGet packages would happily update.
The NuGet package manager fails with the error: Unable to resolve dependencies. 'Microsoft.Extensions.DependencyInjection 2.0.0' is not compatible with 'Microsoft.AspNet.OData 6.1.0 constraint: Microsoft.Extensions.DependencyInjection (>= 1.0.0 && < 2.0.0)'.
The package definition for both 6.0 and 6.1 have the same dependency stated on them. You must use DependencyInjection 1.0/1.1 with both.
When DependencyInjection 2.0.0 support is expected?
Any news here?
I've added MS.Extensions.DependencyInjection & MS.Extensions.DependencyInjection.Abstractions 2.0.0 "explicitly" and my app is working fine. This approach works well with both packages.config and package reference approaches.
Remember that odata automated tests are being executed with version 1, so you've to do this on your own risk.
In apps we've developed, I've not seen any problem, but you should try it yourself
+1
Any fix for this?
+1, really need DI 2.0.0 support.
Please resolve this issue
Second the latest comments. Please fix.
Apparently there are beta nuget packages that we can try that should resolve the issue, I've haven't gotten a chance to test them yet:
Asp.Net Core version: https://www.nuget.org/packages/Microsoft.AspNetCore.OData/7.0.0-beta2
Asp.Net Classic version: https://www.nuget.org/packages/Microsoft.AspNet.OData/7.0.0-beta2
Any news from the Microsoft team regarding this? No ETA yet?
@justintoth unfortunately it won't
Microsoft.Extensions.DependencyInjection (>= 1.0.0 && < 2.0.0)
Microsoft.Extensions.DependencyInjection.Abstractions (>= 1.0.0 && < 2.0.0)
@andrerav
please close this issue to the favor for https://github.com/OData/WebApi/issues/1059
and please subscribe there so owner can see that "we really want this"
@cilerler Yeah I was really disappointed that the beta packages STILL don't support DI 2.x, it's absolutely insane to have to deal with these nuget package conflicts. It's like we're back in the "DLL Hell" era.
@justintoth Agree. This is unacceptable.
Reposting my comment from #1059 for more visibility:
It doesn't seem to be as simple as the package owner just upgrading the DI nuget packages. I forked their repo and tried the upgrade myself, but was blocked because the DI 2.0 nuget packages require .NET Standard 2.0 and the Microsoft.AspNet.OData project is .NET Framework v4.5. I tried upgrading it to v4.7.1 but still no dice. See my SO post, and let me know if you can think of a way around this block.
Most helpful comment
When DependencyInjection 2.0.0 support is expected?