Add System.Web Reference To A Windows 10 Universal App
Asked Answered
A

1

2

I download a project on Gitgub Basically is a Console Application. But I want to translate this C# Console Application to a Universal Windows App.

I want to use HttpUtility.UrlEncode in a windows 10 universal, but I can not find System.Web in .NET (Add Reference) How can I add this assembly to my project?

Error: The "HttpUtility" Does not existin the current context.

Im using Visual Studio 2015

I try with this question: How Add System.Web Reference To A Windows Form Application But doesnt work for the Universal 10 app.

Thanks in advance!

Albite answered 19/2, 2016 at 8:0 Comment(1)
@Damien_The_Unbeliever Thank you!! apparently this fixes the problem.Albite
P
4

The System.Web assembly is a huge monolith that Microsoft themselves seem to be moving away from.

Usually, for any functionality found within System.Web, there's a modern equivalent that can be found elsewhere.

In this case, you'd be looking for WebUtility.UrlEncode instead, which is found in the System.Net assembly and is listed as supported on the Universal Windows Platform.

Ptero answered 19/2, 2016 at 8:36 Comment(4)
Excellent. WARNING TO ALL: If you use HttpUtility.UrlEncode in a UWP app, and utilize resharper to import and reference System.Web, you will likely get the elusive error 0x80073b0f: Processing Resources failed with error: Duplicate Entry and Conflicting values for resource 'System.Design/ClassComments1 errors.Originate
I would like to note that this solution wonderfully corrects those issues, at least for me.Originate
What about all of the other functionality in HttpUtility? -- i.e. HttpUtility.ParseQueryString for example.Futuristic
@Futuristic - UriExtensions.ParseQueryString?Ptero

© 2022 - 2024 — McMap. All rights reserved.