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 extensionUri.ParseQueryString
from small nuget packageMicrosoft.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
- Use another library to handle it (e.g. https://www.nuget.org/packages/MimeTypes)
- Write our own mapper for MIME types
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!