0
votes

I wanna implement compression on my services (netCore webapi) and I've found thi library to do it easily, through this nugget System.Net.Http.Extensions.Compression.Client , the problem is this: that nugget shows a warnning when I try to use it on a .Net Standar 2.0 class library, like my xamarin project, Does anyone knows if there is another library to decompress on the client when the data is comming with compression from the WebApi ? I don't know if the warnning about possible incompatibility on .Net Standar may bring some problems. Can anyone guideme on this matters?

This the warning

Warning NU1701 Package 'System.Net.Http.Extensions.Compression.Client 2.0.5' was restored using '.NETFramework,Version=v4.6.1, .NETFramework,Version=v4.6.2, .NETFramework,Version=v4.7, .NETFramework,Version=v4.7.1, .NETFramework,Version=v4.7.2, .NETFramework,Version=v4.8' instead of the project target framework '.NETStandard,Version=v2.0'. This package may not be fully compatible with your project.

thanks for your help

1

1 Answers

0
votes

As far as I know, this warning means you have reference .NET Framework libraries from .NET Standard.

From MSFT documents:

The supported scenario is referencing a .NET Framework library that happens to only use types within the .NET Standard API set. Also, it is only supported for libraries that target .NET Framework 4.8or earlier (even .NET Framework 1.0 is fine). If the .NET Framework library you reference relies on WPF, the library will not work (or at least not in all cases). You can use libraries that depend on additional APIs,but not for the codepaths you use. In that case, you will need to invest singificantly in testing.

Your application may fail in run-time when you call an API (like something from WPF) that is not supported by .NET Core. Another reason of a failure could be native APIs possibly used by System.Net.Http.Extensions.Compression.Client. So you should test it extensively. But in most cases it will just work on all platforms where .NET Core is supported.

You could also ignore this warning below modify PackageReference as below:

<PackageReference Include="System.Net.Http.Extensions.Compression.Client" Version="2.0.5">
  <NoWarn>NU1701</NoWarn>
</PackageReference>

If you still confused about this warning, I suggest you could try the decompress library like Anemonis.AspNetCore.RequestDecompression.

This library transparent HTTP request decompression middleware for ASP.NET Core 3 based on the RFC 7231, which serves as a complementary component to the Microsoft.AspNetCore.ResponseCompression package.

You could directly install it by using below command:

Install-Package Anemonis.AspNetCore.RequestDecompression -Version 1.8.0