3

I am pretty new to android development and using Xamarin for now.

All looks nice, however as soon I try to use HttpUtility.UrlEncode or HttpWebRequest I need the System.Web.

If I add the System.Web to the references its not being accepted.

Some research gives me the idea that xamarin.android.dll should have the System.Web.dll however I have no idea where to find this one.

Does anybody know how to solve this so HttpUtility and HttpWebRequest will be available in my android project?

Any help would be very appreciated!

0

3 Answers 3

12

HttpWebRequest is part of the System.Net assembly while HttpUtility is part of the System.Web.Services assembly.

(Xamarin Studio).

To add those to your project, simply right click the References folder and choose Edit references

Edit references

In the Edit references dialog you simply make sure the checkbox is checked for System.Net and System.Web.Services.

enter image description here

(Visual Studio)

Right click the References folder and choose Add reference. Next scroll down the list in the Assemblies -> Framework tab and make sure the checkbox is checked for System.Net and System.Web.Services.

enter image description here enter image description here

Sign up to request clarification or add additional context in comments.

4 Comments

Yes this is the one I am looking for however I see you are working with the Xamarin Studio and I work with VS 2012, any change I can get this library into VS2012?
This should work the same way in Visual Studio as in Xamarin Studio. See my updated answer
Correct but I dont have the once from the Android if I use the System.Web (which is from the C# framework) its giving errors
If you go nuts while searching for that package (like me), check if you also target WindowsPhone. For some reason I can't use it there, but on projects, targeting Android or iOS.
0

HttpWebRequest is included in the System.Net namespace (System dll), and HttpUtility is in the System.Web namespace (requires System.Web.Services dll).

For a reference of which namespaces are available, and which dll they live in, see Assemblies.

1 Comment

Not exact where I was looking for as the System.Web should be in the Xamarin.android but I have a hard time to find this one dll
0

Uri.EscapeDataString or Uri.UnescapeDataString may also be an option.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.