none
vb.net failure to recognize any Class HTTPClient code

    Question

  • Incident to trying to make my project work as discussed in https://social.msdn.microsoft.com/Forums/en-US/ad8ca038-f398-4c3c-971a-931e099a5707/creating-a-functional-interface-to-remote-website?forum=vbgeneral, I have been working to use the HTTPClient class.  Every HttpClient command syntax, that I find in examples of the HttpClient implementation, is not accepted as a valid syntax by the VS 2017 IntelliSense or the compiler.

    In trying to figure this out, I note that the HttpClient class Namespace is 'System.Net.Http' and that it requires the 'System.Net.Http.dll'.  When I check, I find the System.Net.Http listed in the references section of the Solution Explorer, but a search of my computer does NOT find an installation of System.Net.Http.dll.  I am assuming that the lack of this .dll file is causing the HttpClient class not to be defined in the development environment and therefore not allowing command syntax from this class.

    (1) How do I fix this?  Am I correct in thinking I need to find and load the System.net.Http.dll file?  If so, how do I do this?

    My project has a feature which
    1. opens a webpage on a remote server.  The webpage is served from a hosted server, that I control.
    2. automatically loads address data into two input boxes on this webpage, and then automatically executes the Submit button (remotely clicks the Submit).  The website then shows the two addresses on a Google maps and draws a great circle path between the two addresses.

    What VB.Net HttpClient commands would accomplish this?

    Bob


    Bob Goodwin

    Wednesday, April 05, 2017 2:49 PM

Answers

  • Hi Bob,

    Please see your other thread linked above for an example of how to use the HttpClient.

    As for your other issue, are you saying that the reference to System.Net.Http is added to the project but you cannot compile code using members of the Net.Http namespace?  Does your references tab look like this?

    That's from VS2015 but it should be similar in 17.


    Reed Kimble - "When you do things right, people won't be sure you've done anything at all"

    • Marked as answer by BobGn Wednesday, April 05, 2017 5:31 PM
    Wednesday, April 05, 2017 3:14 PM
    Moderator
  • it is the same in 2017, be aware that is not VB17 (meant for Reed to avoid this kind of future mistakes people tell) :-)


    Success
    Cor

    • Marked as answer by BobGn Wednesday, April 05, 2017 4:35 PM
    Wednesday, April 05, 2017 3:20 PM

All replies

  • Bob,

    I think you can better go on with that question in the original thread. 

    It is not closed. I'm also curious how Reed will push information in a web page by using HTTPClient. 

    If it is about getting the data, you can use this sample on our website.

    http://www.vb-tips.com/MSHTML.aspx


    Success
    Cor

    Wednesday, April 05, 2017 3:12 PM
  • Hi Bob,

    Please see your other thread linked above for an example of how to use the HttpClient.

    As for your other issue, are you saying that the reference to System.Net.Http is added to the project but you cannot compile code using members of the Net.Http namespace?  Does your references tab look like this?

    That's from VS2015 but it should be similar in 17.


    Reed Kimble - "When you do things right, people won't be sure you've done anything at all"

    • Marked as answer by BobGn Wednesday, April 05, 2017 5:31 PM
    Wednesday, April 05, 2017 3:14 PM
    Moderator
  • it is the same in 2017, be aware that is not VB17 (meant for Reed to avoid this kind of future mistakes people tell) :-)


    Success
    Cor

    • Marked as answer by BobGn Wednesday, April 05, 2017 4:35 PM
    Wednesday, April 05, 2017 3:20 PM
  • Cor,
      The System.Net.Http checkbox was not originally checked on my installation.  Even after I checked it, closed and restarted VS 2017, HttpClient code examples were not accepted.  However, when I looked into the 'Properties' for my project I found the System.Net.Http checkbox listed as a reference, as shown below, but I noticed that the imported Namespaces did NOT include System.Net.Http.  I checked that, closed and restarted VS 2017, and now the project is properly accepting HttpClient syntax.  Here's hope that I can do what I want with HttpClient.

    Bob Goodwin


    Bob Goodwin

    Wednesday, April 05, 2017 4:29 PM
  • Cor,
        The task is to open an existing web page, load an address into each of two input text boxes on the website that was opened, and then to 'click' the Submit button, all with VB.net code.  You seem to believe that the HttpClient Class is not the correct one for this task.  If so, what do you recommend?  I'd just as soon not go all the way down the HttpClient road if it  is  known to be a dead end.

         You have solved my initial problem, so I will mark your previous response as the solution, but I'd love an answer to this question (which is also answering the other Open question cited in the problem statement above).

    Thanks!

    Bob Goodwin


    Bob Goodwin

    Wednesday, April 05, 2017 4:34 PM