Replies: 1 comment
-
@bit365 You have your reference reversed: if you want to call (reference) service1 from service2, service2 needs to reference service1: Additionally, regarding testing, could you show how you're creating your HttpClient? It's different in testing for now: you need to call Here is some example code: var httpClient = app.CreateHttpClient("mywebapp1", "https");
var result = await httpClient.GetFromJsonAsync<WeatherForecast[]>("/weatherforecast"); |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
host code:
service1.WithReference(service2)
service2 code:
httpClient.GetAsync("https://service1")
Running the HOST project directly is able to serve discovery and work properly, and service1 is resolved to the endpoint.
If you use DistributedApplicationTestingBuilder to start a test environment and perform integration tests on service2, httpClient.GetAsync("https://service1") fails to work, prompting an unknown service1 host and invalidating service discovery.
Beta Was this translation helpful? Give feedback.
All reactions