Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

The type or namespace name "WebRequestHandler" could not be found

Tags:

I am trying to use the Dropbox.API code that is listed here:

https://github.com/dropbox/dropbox-sdk-dotnet/tree/master/dropbox-sdk-dotnet/Examples/SimpleTest

I copied their Program.cs into my Program.cs without making other changes to other files in my solution/project.

I am getting

The type or namespace name "WebRequestHandler" could not be found.

enter image description here

Despite having this using statement:

using System.Net.Http;

The help text says to add an assembly reference, but I don't know what I would add.

I tried moving the using System.Net.Http to both inside and outside the class.

I am new to C# and .Net development so expect this to be a really newbie problem.

like image 963
Be Kind To New Users Avatar asked Aug 30 '17 11:08

Be Kind To New Users


1 Answers

Have you included a reference to the System.Net.Http.WebRequest DLL? This is where the WebRequestHandler is found, not in System.Net.Http.

See this article on MSDN.

In short, you can add the reference to System.Net.Http.WebRequest DLL by right clicking on the project and doing Add -> Reference. Expect a popup window to appear and then put a checkmark next to System.Net.Http.WebRequest.

like image 148
GrandMasterFlush Avatar answered Sep 28 '22 07:09

GrandMasterFlush