You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
What am I trying to do: Connect to an api and retrieve data.
In my Test Solution Project, which i have converted from .Net Framework to .Net 5, it gives me this error. Unable to cast object of type 'UIHelpersRestClientRefitBugIWoofClient' to type 'UI.Helpers.RestClient.RefitBug.IWoofClient.
To diagnose, I've made a standalone project and this works perfectly (same code), so I know this may not be a bug or even a straightforward bug.
namespace UI.Helpers.RestClient.RefitBug
{
interface IWoofClient
{
[Refit.Get("/woof.json")]
Task<WoofResponseObject> GetDawg();
}
}
public WoofClient()
{
_baseUrl = new Uri("https://random.dog/");
ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12;
{
//below is where the error occurs
IWoofClient = Refit.RestService.For<IWoofClient>(
new HttpClient()
{
BaseAddress = _baseUrl
});
}
}
As I mentioned, this works in the Test Solution that is using .Net Framework.
Environment
OS: Win 10
Visual Studio Pro 16.9.1
.Net 5
Package Version: 6.0.24
The text was updated successfully, but these errors were encountered:
Describe the bug
What am I trying to do: Connect to an api and retrieve data.
In my Test Solution Project, which i have converted from .Net Framework to .Net 5, it gives me this error.
Unable to cast object of type 'UIHelpersRestClientRefitBugIWoofClient' to type 'UI.Helpers.RestClient.RefitBug.IWoofClient.
To diagnose, I've made a standalone project and this works perfectly (same code), so I know this may not be a bug or even a straightforward bug.
As I mentioned, this works in the Test Solution that is using .Net Framework.
Environment
OS: Win 10
Visual Studio Pro 16.9.1
.Net 5
Package Version: 6.0.24
The text was updated successfully, but these errors were encountered: