box / box-windows-sdk-v2

Windows SDK for v2 of the Box API. The SDK is built upon .NET Framework 4.5

Home Page:https://developer.box.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Can you please remove dependency from System.Web.dll

23W opened this issue · comments

Is your feature request related to a problem? Please describe.

Redundant resources consuming. Dependency from whole .Net Framework (System.Web is not part of the .NET Framework Client Profile).

Describe the solution you'd like

Box.V2 .Net Framework. version has dependency from System.Web.dll that was designed to be used in ASP.NET MVC or ASP.NET Web application, i.e. for backend side not for clients. This is a big and heavy dependency that consumes process memory.

For client side applications Microsoft recommends to use other classes and methods than those in System.Web.dll assembly.
For example: for HttpUtility methods they recomend to use WebUtility equivalents

To encode or decode values outside of a web application, use the [WebUtility](https://learn.microsoft.com/en-us/dotnet/api/system.net.webutility?view=net-8.0) class.

Describe alternatives you've considered

In most cases app has dependency from System.Web because of utility class HttpUtility . But in most cases it can be replaces by alternatives from System.Net namespace:

  • HttpUtility.HtmlDecode -> WebUtility.HtmlDecode
  • HttpUtility.HtmlEncode -> WebUtility.HtmlEncode
  • HttpUtility.UrlDecode -> WebUtility.UlrDecode
  • HttpUtility.UrlEncode -> WebUtility.UrlEncode
  • HttpUtility.ParseQueryString -> Uri extension Uri.ParseQueryString from small nuget package Microsoft.AspNet.WebApi.Client

Additional context

Any plans on this issue?

Hi @23W

Sorry for the late reply. I see that the SDK uses System.Web.dll in the .NET Framework part to get the correct MIME types for avatar related requests. I am not aware of any lightweight Microsoft replacement library for this functionality. It seems to me that there are two paths we can take

How important is it to your project?

I have created a ticket to track this is issue internally (SDK-3142), but I can't give any timeframe at the moment when this change will be implemented. PRs are always welcome!