0

The Assembly and both apps are built using VS2019 Visual Basic:

I need to use .NET Framework to build a Windows app, because the program will be ran on some old, possibly XP computers, in some of the 50 private locations around the USA and Canada. I do not have control over what the customers use.

I have an assemble that will return a request from an API if the Windows app that references the the assembly (ClassLibrary .NET Framework 3.5, RestSharp.Net20, Newtonsoft.Json) is built with .NET Core 3.1, but not if the Windows app is built with .NET Framework 3.5.

The assembly code is very straight forward.

    Dim client As New RestSharp.RestClient With {.BaseUrl = New Uri(apiURL + "api/vault/" + id)}

    Dim request As New RestRequest(Method.GET)
    request.AddHeader("Authorization", _apiKey)
    request.AddHeader("Content-Type", "application/json")

    Dim response = client.Execute(request)
    x = response.StatusCode.ToString

If I call this from the .NET Core app, the response.StatusCode is Ok and a Json string is returned. When this is called from the .NET Framework app, the response.StatusCode is 0 and nothing is returned. The "client" seems to be set correctly with either calling app.

Am I missing something in the .NET Framework app?

Erik Eidt
  • 23,049
  • 2
  • 29
  • 53
RichG
  • 1
  • 2

0 Answers0