Describe the bugAspNetCoreCommunicationListener has the option ConfigureToUseUniqueServiceUrl which is an internal method called by WebHostBuilderServiceFabricExtension.cs if the ServiceFabricIntegrationOptions UseUniquestServiceUrl is set to true. The IHost was added to KestrelCommunicationListener which inherits from AspNetCoreCommunicationListener. There is test for uniqueness option with AspNetCoreCommunicationListenerTests which is used by the Kestrel Tests. The bug is that since the test is part of the same assembly it can call the internal method ConfigureToUseUniqueServiceUrl but since there is no Extension for IHostBuilder there is no way to implement an extension to call this method.
To Reproduce
Implement your own Host Builder extension using KestrelCommunicationListener like the following and see that the method in question is not accessible.
public static IHostBuilder UseServiceFabricIntegration(this IHostBuilder hostBuilder,
KestrelCommunicationListener listener,
Runtime.ServiceFabricIntegrationOptions options)
{
if (hostBuilder == null)
{
throw new ArgumentNullException(nameof(hostBuilder));
}
if (listener == null)
{
throw new ArgumentNullException(nameof(listener));
}
// use environmental variable to replace this logic
// // Check if 'UseServiceFabricIntegration' has already been called.
if (listener.HasUseServiceFabricIntegrationBeenCalled) return hostBuilder;
// // Set flag to prevent double service configuration
listener.HasUseServiceFabricIntegrationBeenCalled = true;
if (options.HasFlag(Runtime.ServiceFabricIntegrationOptions.UseUniqueServiceUrl))
{
listener.ConfigureToUseUniqueServiceUrl();
}
hostBuilder.ConfigureServices((services) =>
{
services.AddSingleton<IStartupFilter>(new ServiceFabricSetupFilter(listener.UrlSuffix, options));
});
return hostBuilder;
}
Expected behavior
Expose this method so that it accessible through inheritance or create a new Extension Method for IHostBuilder.
Additional context
During a previous upgrade several years ago to .net core 3.1 we just implemented our own listener to emulate the KestrelCommunicationListener and added IHost and IHostBuilder functionality and now that we are migrating to NET6 we would like to not to have to do this again. This is similar in nature to Issue 48 but I believe this is not a feature request because to the for mentioned issue. It would seem that it would take five minutes to create a new extension method to accomplish this.
Describe the bug
AspNetCoreCommunicationListener
has the optionConfigureToUseUniqueServiceUrl
which is aninternal method
called by WebHostBuilderServiceFabricExtension.cs if the ServiceFabricIntegrationOptions UseUniquestServiceUrl is set to true. TheIHost
was added toKestrelCommunicationListener
which inherits fromAspNetCoreCommunicationListener
. There is test for uniqueness option with AspNetCoreCommunicationListenerTests which is used by the Kestrel Tests. The bug is that since the test is part of the same assembly it can call the internal methodConfigureToUseUniqueServiceUrl
but since there is no Extension forIHostBuilder
there is no way to implement an extension to call this method.To Reproduce Implement your own Host Builder extension using
KestrelCommunicationListener
like the following and see that the method in question is not accessible.Expected behavior Expose this method so that it accessible through inheritance or create a new Extension Method for IHostBuilder.
Additional context During a previous upgrade several years ago to .net core 3.1 we just implemented our own listener to emulate the KestrelCommunicationListener and added
IHost
andIHostBuilder
functionality and now that we are migrating to NET6 we would like to not to have to do this again. This is similar in nature to Issue 48 but I believe this is not a feature request because to the for mentioned issue. It would seem that it would take five minutes to create a new extension method to accomplish this.