GeoIP2-dotnet icon indicating copy to clipboard operation
GeoIP2-dotnet copied to clipboard

Versioning of dependency on Microsoft.Extensions.Options

Open older opened this issue 4 years ago • 4 comments

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:

  • 2.1.1 for netstandard2.0
  • 3.1.11 for netstandard2.1
  • 5.0.0 for net5.0

older avatar Jan 14 '21 01:01 older

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?

oschwald avatar Jan 14 '21 03:01 oschwald

@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.

older avatar Jan 14 '21 08:01 older

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.

kabilanvk avatar May 21 '21 16:05 kabilanvk

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.

older avatar May 25 '21 09:05 older