maxmind / GeoIP2-dotnet

MaxMind GeoIP2 .NET API
https://www.nuget.org/packages/MaxMind.GeoIP2
Apache License 2.0
352 stars 78 forks source link

Versioning of dependency on Microsoft.Extensions.Options #150

Open older opened 3 years ago

older commented 3 years ago

Right now dependency on Microsoft.Extensions.Options is set to version 5.0.0 for all target frameworks. This makes it impossible to use in Azure Functions as Azure Functions runtime is not yet updated to .NET 5. Would it be possible to set this reference to lowest supported LTS version per target framework:

oschwald commented 3 years ago

Would you be able to expand on why this is necessary? That is a package reference to the NuGet package. Why do you need .NET 5.0?

older commented 3 years ago

@oschwald This NuGet package sets minimal version of Microsoft.Extensions.Options to version 5.0.0 so my function app is built with this version when I have reference on MaxMind.GeoIP2. But Azure Functions runtime is built with version 3.x and this version is loaded by runtime before my application starts. So as a result I get this exception. This is easily reproducible and happens not only when the app is deployed to Azure, but also if I run it locally using Azure Functions tools.

kabilanvk commented 3 years ago

Since .Net 5 for functions shows it's still in PREVIEW. I had to stick to 3.1 then reverting to MaxMind.GeoIP2 3.3.0 worked for me.

older commented 3 years ago

It is not only for functions. According to this comment from Microsoft's engineering manager for ASP.NET Core, Entity Framework, and Winforms, versions of extensions packages should match the major/minor of the ASP.NET Core.