Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ServiceEndPointResolver.GetEndPointsAsync not work with net.tcp scheme #3746

Open
gdantuono opened this issue Apr 17, 2024 · 1 comment
Open
Labels
area-service-discovery enhancement An enhancement to an existing feature or capability.

Comments

@gdantuono
Copy link

gdantuono commented Apr 17, 2024

Package: Microsoft.Extentions.ServiceDiscovery 8 preview 5

I would like to use the ServiceDiscovery library to be able to retrieve the Endpoint of a WCF service with net.tcp protocol.

But this code return null:

var endPointResolver = serviceProvider.GetRequiredService<ServiceEndPointResolver>();
var result = await endPointResolver.GetEndPointAsync("net.tcp://basket", default).ConfigureAwait(false);
Assert.IsNull(result);

Configuration appSettings.json:

{
  "Services": {
    "basket": {
      "net.tcp": "net.tcp://localhost:82378"
    }
  }
}
@gdantuono
Copy link
Author

I found that by mistake in configuration I set an invalid port.

When the port exceeds 65535 (by configuration error), the GetEndPointsAsync method returns null.

Perhaps it would be better to raise an exception when loading the configuration?

@davidfowl davidfowl added the enhancement An enhancement to an existing feature or capability. label Sep 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-service-discovery enhancement An enhancement to an existing feature or capability.
Projects
None yet
Development

No branches or pull requests

2 participants