hothoc - calling REST API endpoint troubleshooting
If you're getting the following error messages :-
"Could not deserialize the response body stream as System.Collections.Generic.ICollection`1[[TodoReader.WeatherForecast]'
Or
"Unable to resolve service for type 'System.String' while attempting to activate service"
These are indications that the conversion issue from JSON after calling the endpoint is not working. To troubleshoot this - NSWAG typically generate code that hides the actual error. You have to do some debugging and find out which type wasn't really being serialized successfully.
Or
"No service for type 'System.Net.Http.IHttpClientFactory' has been registered."
This means you haven't register IHttpClientFactory to your service.
Comments