Repository: MassTransit/MassTransit

Issue #5060: Error SQL Transport with back slash in host, The hostname could not be parsed.
Created: 2024-04-01T16:04:04Z
Contact Details
No response
Version
8.x
On which operating system(s) are you experiencing the issue?
Windows
Using which broker(s) did you encounter the issue?
RabbitMQ, In-Memory
What are the steps required to reproduce the issue?
1.Configure SQL Transport with localhost\\SQLEXPRESS
2.Play the solution
3.Error
What is the expected behavior?
I created the solution with my local SQL server
What actually happened?
Error with my configuration
`public static IServiceCollection ConfigureSqlServerTransport(this IServiceCollection services, string? connectionString, bool create = true,
bool delete = false)
{
var builder = new SqlConnectionStringBuilder(connectionString);
    services.AddOptions<SqlTransportOptions>().Configure(options =>
    {
        options.Host = "localhost\\SQLEXPRESS";
        options.Database = builder.InitialCatalog ?? "MassTransitSample";
        options.Schema = "transport";
        options.Role = "transport";
        options.Username = "akiragothick";
        options.Password = "afdsd/";
        options.AdminUsername = "sa";
        options.AdminPassword = "sdf4f4#";
    });

    services.AddSqlServerMigrationHostedService(create, delete);

    return services;
}`


Related log output, including any exceptions
`System.UriFormatException: Invalid URI: The hostname could not be parsed.
   at System.Uri.CreateThis(String uri, Boolean dontEscape, UriKind uriKind, UriCreationOptions& creationOptions)
   at System.Uri..ctor(String uriString)
   at System.UriBuilder.get_Uri()
   at MassTransit.SqlHostAddress.op_Implicit(SqlHostAddress& address) in /_/src/MassTransit/SqlTransport/SqlHostAddress.cs:line 132
   at MassTransit.SqlTransport.Configuration.ConfigurationSqlHostSettings.FormatHostAddress() in /_/src/MassTransit/SqlTransport/SqlTransport/Configuration/ConfigurationSqlHostSettings.cs:line 96
   at System.Lazy`1.ViaFactory(LazyThreadSafetyMode mode)
   at System.Lazy`1.ExecutionAndPublication(LazyHelper executionAndPublication, Boolean useDefaultConstructor)
   at System.Lazy`1.CreateValue()
   at MassTransit.SqlTransport.Configuration.ConfigurationSqlHostSettings.get_HostAddress() in /_/src/MassTransit/SqlTransport/SqlTransport/Configuration/ConfigurationSqlHostSettings.cs:line 82
   at MassTransit.SqlTransport.Configuration.SqlHostConfiguration.get_HostAddress() in /_/src/MassTransit/SqlTransport/SqlTransport/Configuration/SqlHostConfiguration.cs:line 45
   at MassTransit.SqlTransport.Configuration.SqlReceiveEndpointConfiguration.FormatInputAddress() in /_/src/MassTransit/SqlTransport/SqlTransport/Configuration/SqlReceiveEndpointConfiguration.cs:line 203
   at System.Lazy`1.ViaFactory(LazyThreadSafetyMode mode)
   at System.Lazy`1.ExecutionAndPublication(LazyHelper executionAndPublication, Boolean useDefaultConstructor)
   at System.Lazy`1.CreateValue()
   at MassTransit.SqlTransport.Configuration.SqlReceiveEndpointConfiguration.get_InputAddress() in /_/src/MassTransit/SqlTransport/SqlTransport/Configuration/SqlReceiveEndpointConfiguration.cs:line 44
   at MassTransit.DependencyInjection.Registration.ConsumerRegistration`1.MassTransit.Configuration.IConsumerRegistration.Configure(IReceiveEndpointConfigurator configurator, IRegistrationContext context) in /_/src/MassTransit/DependencyInjection/DependencyInjection/Registration/Consumers/ConsumerRegistration.cs:line 57
   at MassTransit.Configuration.RegistrationContext.ConfigureConsumer(Type consumerType, IReceiveEndpointConfigurator configurator) in /_/src/MassTransit/DependencyInjection/Configuration/RegistrationContext.cs:line 29
   at MassTransit.Configuration.BusRegistrationContext.<>c__DisplayClass7_1`1.<ConfigureTheEndpoints>b__0(T cfg) in /_/src/MassTransit/DependencyInjection/Configuration/BusRegistrationContext.cs:line 178
   at MassTransit.SqlTransport.Configuration.SqlHostConfiguration.<>c__DisplayClass23_0.<ReceiveEndpoint>b__0(ISqlReceiveEndpointConfigurator configurator) in /_/src/MassTransit/SqlTransport/SqlTransport/Configuration/SqlHostConfiguration.cs:line 104
   at MassTransit.SqlTransport.Configuration.SqlHostConfiguration.CreateReceiveEndpointConfiguration(SqlReceiveSettings settings, ISqlEndpointConfiguration endpointConfiguration, Action`1 configure) in /_/src/MassTransit/SqlTransport/SqlTransport/Configuration/SqlHostConfiguration.cs:line 86
   at MassTransit.SqlTransport.Configuration.SqlHostConfiguration.CreateReceiveEndpointConfiguration(String queueName, Action`1 configure) in /_/src/MassTransit/SqlTransport/SqlTransport/Configuration/SqlHostConfiguration.cs:line 73
   at MassTransit.SqlTransport.Configuration.SqlHostConfiguration.ReceiveEndpoint(String queueName, Action`1 configureEndpoint) in /_/src/MassTransit/SqlTransport/SqlTransport/Configuration/SqlHostConfiguration.cs:line 109
   at MassTransit.SqlTransport.Configuration.SqlHostConfiguration.ReceiveEndpoint(IEndpointDefinition definition, IEndpointNameFormatter endpointNameFormatter, Action`1 configureEndpoint) in /_/src/MassTransit/SqlTransport/SqlTransport/Configuration/SqlHostConfiguration.cs:line 100
   at MassTransit.SqlTransport.Configuration.SqlBusFactoryConfigurator.ReceiveEndpoint(IEndpointDefinition definition, IEndpointNameFormatter endpointNameFormatter, Action`1 configureEndpoint) in /_/src/MassTransit/SqlTransport/SqlTransport/Configuration/SqlBusFactoryConfigurator.cs:line 111
   at MassTransit.Configuration.BusRegistrationContext.ConfigureTheEndpoints[T](IEnumerable`1 endpoints, IEndpointNameFormatter endpointNameFormatter, Func`2 getEndpointDefinitionByName, IReceiveConfigurator`1 configurator, IReceiveConfigurator`1 instanceConfigurator) in /_/src/MassTransit/DependencyInjection/Configuration/BusRegistrationContext.cs:line 173
   at MassTransit.Configuration.BusRegistrationContext.ConfigureEndpoints[T](IReceiveConfigurator`1 configurator, IEndpointNameFormatter endpointNameFormatter, Action`1 configureFilter) in /_/src/MassTransit/DependencyInjection/Configuration/BusRegistrationContext.cs:line 147
   at MassTransit.Configuration.BusRegistrationContext.ConfigureEndpoints[T](IReceiveConfigurator`1 configurator, IEndpointNameFormatter endpointNameFormatter) in /_/src/MassTransit/DependencyInjection/Configuration/BusRegistrationContext.cs:line 28
   at MassTransit.RegistrationContextExtensions.ConfigureEndpoints[T](IBusFactoryConfigurator`1 configurator, IBusRegistrationContext registration, IEndpointNameFormatter endpointNameFormatter) in /_/src/MassTransit/Configuration/RegistrationContextExtensions.cs:line 23
   at Program.<>c.<<Main>$>b__0_14(IBusRegistrationContext context, ISqlBusFactoryConfigurator cfg) in E:\TEST_PROYECTS\MassTransit\ApiSampleSQLServer\Program.cs:line 114
   at MassTransit.SqlServerBusFactoryConfiguratorExtensions.<>c__DisplayClass0_0.<UsingSqlServer>b__0(IBusRegistrationContext context, ISqlBusFactoryConfigurator cfg) in /_/src/Transports/MassTransit.SqlTransport.SqlServer/Configuration/SqlServerBusFactoryConfiguratorExtensions.cs:line 22
   at MassTransit.Configuration.TransportRegistrationBusFactory`1.CreateBus[T,TConfigurator](T configurator, IBusRegistrationContext context, Action`2 configure, IEnumerable`1 specifications) in /_/src/MassTransit/DependencyInjection/Configuration/TransportRegistrationBusFactory.cs:line 36
   at MassTransit.SqlTransport.Configuration.SqlRegistrationBusFactory.CreateBus(IBusRegistrationContext context, IEnumerable`1 specifications, String busName) in /_/src/MassTransit/SqlTransport/SqlTransport/Configuration/SqlRegistrationBusFactory.cs:line 46
   at MassTransit.Configuration.ServiceCollectionBusConfigurator.CreateBus[T](T busFactory, IServiceProvider provider) in /_/src/MassTransit/DependencyInjection/Configuration/ServiceCollectionBusConfigurator.cs:line 120
   at MassTransit.Configuration.ServiceCollectionBusConfigurator.<>c__DisplayClass3_0`1.<SetBusFactory>b__0(IServiceProvider provider) in /_/src/MassTransit/DependencyInjection/Configuration/ServiceCollectionBusConfigurator.cs:line 82
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor`2.VisitCallSiteMain(ServiceCallSite callSite, TArgument argument)
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitRootCache(ServiceCallSite callSite, RuntimeResolverContext context)
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor`2.VisitCallSite(ServiceCallSite callSite, TArgument argument)
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.Resolve(ServiceCallSite callSite, ServiceProviderEngineScope scope)
   at Microsoft.Extensions.DependencyInjection.ServiceProvider.CreateServiceAccessor(ServiceIdentifier serviceIdentifier)
   at System.Collections.Concurrent.ConcurrentDictionary`2.GetOrAdd(TKey key, Func`2 valueFactory)
   at Microsoft.Extensions.DependencyInjection.ServiceProvider.GetService(ServiceIdentifier serviceIdentifier, ServiceProviderEngineScope serviceProviderEngineScope)
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.ServiceProviderEngineScope.GetService(Type serviceType)
   at Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService(IServiceProvider provider, Type serviceType)
   at Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService[T](IServiceProvider provider)
   at MassTransit.Configuration.ServiceCollectionBusConfigurator.<>c__3`1.<SetBusFactory>b__3_1(IServiceProvider provider) in /_/src/MassTransit/DependencyInjection/Configuration/ServiceCollectionBusConfigurator.cs:line 84
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor`2.VisitCallSiteMain(ServiceCallSite callSite, TArgument argument)
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitRootCache(ServiceCallSite callSite, RuntimeResolverContext context)
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor`2.VisitCallSite(ServiceCallSite callSite, TArgument argument)
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitIEnumerable(IEnumerableCallSite enumerableCallSite, RuntimeResolverContext context)
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor`2.VisitCallSiteMain(ServiceCallSite callSite, TArgument argument)
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitRootCache(ServiceCallSite callSite, RuntimeResolverContext context)
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor`2.VisitCallSite(ServiceCallSite callSite, TArgument argument)
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitConstructor(ConstructorCallSite constructorCallSite, RuntimeResolverContext context)
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor`2.VisitCallSiteMain(ServiceCallSite callSite, TArgument argument)
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitRootCache(ServiceCallSite callSite, RuntimeResolverContext context)
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor`2.VisitCallSite(ServiceCallSite callSite, TArgument argument)
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitIEnumerable(IEnumerableCallSite enumerableCallSite, RuntimeResolverContext context)
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor`2.VisitCallSiteMain(ServiceCallSite callSite, TArgument argument)
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitRootCache(ServiceCallSite callSite, RuntimeResolverContext context)
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor`2.VisitCallSite(ServiceCallSite callSite, TArgument argument)
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitConstructor(ConstructorCallSite constructorCallSite, RuntimeResolverContext context)
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor`2.VisitCallSiteMain(ServiceCallSite callSite, TArgument argument)
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitDisposeCache(ServiceCallSite transientCallSite, RuntimeResolverContext context)
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor`2.VisitCallSite(ServiceCallSite callSite, TArgument argument)
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitConstructor(ConstructorCallSite constructorCallSite, RuntimeResolverContext context)
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor`2.VisitCallSiteMain(ServiceCallSite callSite, TArgument argument)
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitRootCache(ServiceCallSite callSite, RuntimeResolverContext context)
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor`2.VisitCallSite(ServiceCallSite callSite, TArgument argument)
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitConstructor(ConstructorCallSite constructorCallSite, RuntimeResolverContext context)
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor`2.VisitCallSiteMain(ServiceCallSite callSite, TArgument argument)
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitRootCache(ServiceCallSite callSite, RuntimeResolverContext context)
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor`2.VisitCallSite(ServiceCallSite callSite, TArgument argument)
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.Resolve(ServiceCallSite callSite, ServiceProviderEngineScope scope)
   at Microsoft.Extensions.DependencyInjection.ServiceProvider.CreateServiceAccessor(ServiceIdentifier serviceIdentifier)
   at System.Collections.Concurrent.ConcurrentDictionary`2.GetOrAdd(TKey key, Func`2 valueFactory)
   at Microsoft.Extensions.DependencyInjection.ServiceProvider.GetService(ServiceIdentifier serviceIdentifier, ServiceProviderEngineScope serviceProviderEngineScope)
   at Microsoft.Extensions.DependencyInjection.ServiceProvider.GetService(Type serviceType)
   at Microsoft.AspNetCore.Builder.HealthCheckEndpointRouteBuilderExtensions.MapHealthChecksCore(IEndpointRouteBuilder endpoints, String pattern, HealthCheckOptions options)
   at Program.<Main>$(String[] args) in E:\TEST_PROYECTS\MassTransit\ApiSampleSQLServer\Program.cs:line 199`
Link to repository that demonstrates/reproduces the issue
https://github.com/akiragothick/masstransit-test2

Duplicate issue #5072: Using LocalDb as host throws for SQL Transport on startup
Created: 2024-04-04T20:21:25Z
Contact Details
No response
Version
8.x (develop, pre-release), 8.x
On which operating system(s) are you experiencing the issue?
Windows
Using which broker(s) did you encounter the issue?
No response
What are the steps required to reproduce the issue?
Using the default value of the localdb `(localdb)\mssqllocaldb` throws an exception on startup. Problematic values seem to be: ( ) \

#5060 fixes the issue only partially because ( ) are still problematic.

UriFormatException is thrown here on UriBuilder.Uri: https://github.com/MassTransit/MassTransit/blob/f70db01d45525c256e4e9f1d206189cbeb3fb343/src/MassTransit/SqlTransport/SqlHostAddress.cs#L152

Minimal repro:
using MassTransit;

var builder = WebApplication.CreateBuilder(args);

builder.Services.AddMassTransit(x =>
{
    x.UsingSqlServer();
    x.AddOptions<SqlTransportOptions>().Configure(options =>
    {
        options.Host = "(localdb)\\mssqllocaldb";
    });
});

var app = builder.Build();

app.Run();
What is the expected behavior?
All values valid in a connection string should work.
What actually happened?
Using the default host value for the local db throws an exception.
Related log output, including any exceptions
MassTransit.ConfigurationException
  HResult=0x80131500
  Message=An exception occurred during bus creation
  Source=MassTransit
  StackTrace:
   at MassTransit.Configuration.TransportRegistrationBusFactory`1.CreateBus[T,TConfigurator](T configurator, IBusRegistrationContext context, Action`2 configure, IEnumerable`1 specifications) in /_/src/MassTransit/DependencyInjection/Configuration/TransportRegistrationBusFactory.cs:line 78
   at MassTransit.SqlTransport.Configuration.SqlRegistrationBusFactory.CreateBus(IBusRegistrationContext context, IEnumerable`1 specifications, String busName) in /_/src/MassTransit/SqlTransport/SqlTransport/Configuration/SqlRegistrationBusFactory.cs:line 46
   at MassTransit.Configuration.ServiceCollectionBusConfigurator.CreateBus[T](T busFactory, IServiceProvider provider) in /_/src/MassTransit/DependencyInjection/Configuration/ServiceCollectionBusConfigurator.cs:line 120
   at MassTransit.Configuration.ServiceCollectionBusConfigurator.<>c__DisplayClass3_0`1.<SetBusFactory>b__0(IServiceProvider provider) in /_/src/MassTransit/DependencyInjection/Configuration/ServiceCollectionBusConfigurator.cs:line 82
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor`2.VisitCallSiteMain(ServiceCallSite callSite, TArgument argument)
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitRootCache(ServiceCallSite callSite, RuntimeResolverContext context)
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor`2.VisitCallSite(ServiceCallSite callSite, TArgument argument)
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.Resolve(ServiceCallSite callSite, ServiceProviderEngineScope scope)
   at Microsoft.Extensions.DependencyInjection.ServiceProvider.CreateServiceAccessor(ServiceIdentifier serviceIdentifier)
   at System.Collections.Concurrent.ConcurrentDictionary`2.GetOrAdd(TKey key, Func`2 valueFactory)
   at Microsoft.Extensions.DependencyInjection.ServiceProvider.GetService(ServiceIdentifier serviceIdentifier, ServiceProviderEngineScope serviceProviderEngineScope)
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.ServiceProviderEngineScope.GetService(Type serviceType)
   at Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService(IServiceProvider provider, Type serviceType)
   at Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService[T](IServiceProvider provider)
   at MassTransit.Configuration.ServiceCollectionBusConfigurator.<>c__3`1.<SetBusFactory>b__3_1(IServiceProvider provider) in /_/src/MassTransit/DependencyInjection/Configuration/ServiceCollectionBusConfigurator.cs:line 84
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor`2.VisitCallSiteMain(ServiceCallSite callSite, TArgument argument)
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitRootCache(ServiceCallSite callSite, RuntimeResolverContext context)
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor`2.VisitCallSite(ServiceCallSite callSite, TArgument argument)
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitIEnumerable(IEnumerableCallSite enumerableCallSite, RuntimeResolverContext context)
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor`2.VisitCallSiteMain(ServiceCallSite callSite, TArgument argument)
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitRootCache(ServiceCallSite callSite, RuntimeResolverContext context)
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor`2.VisitCallSite(ServiceCallSite callSite, TArgument argument)
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitConstructor(ConstructorCallSite constructorCallSite, RuntimeResolverContext context)
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor`2.VisitCallSiteMain(ServiceCallSite callSite, TArgument argument)
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitRootCache(ServiceCallSite callSite, RuntimeResolverContext context)
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor`2.VisitCallSite(ServiceCallSite callSite, TArgument argument)
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitIEnumerable(IEnumerableCallSite enumerableCallSite, RuntimeResolverContext context)
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor`2.VisitCallSiteMain(ServiceCallSite callSite, TArgument argument)
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitRootCache(ServiceCallSite callSite, RuntimeResolverContext context)
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor`2.VisitCallSite(ServiceCallSite callSite, TArgument argument)
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitConstructor(ConstructorCallSite constructorCallSite, RuntimeResolverContext context)
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor`2.VisitCallSiteMain(ServiceCallSite callSite, TArgument argument)
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitDisposeCache(ServiceCallSite transientCallSite, RuntimeResolverContext context)
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor`2.VisitCallSite(ServiceCallSite callSite, TArgument argument)
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitConstructor(ConstructorCallSite constructorCallSite, RuntimeResolverContext context)
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor`2.VisitCallSiteMain(ServiceCallSite callSite, TArgument argument)
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitRootCache(ServiceCallSite callSite, RuntimeResolverContext context)
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor`2.VisitCallSite(ServiceCallSite callSite, TArgument argument)
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitConstructor(ConstructorCallSite constructorCallSite, RuntimeResolverContext context)
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor`2.VisitCallSiteMain(ServiceCallSite callSite, TArgument argument)
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitRootCache(ServiceCallSite callSite, RuntimeResolverContext context)
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor`2.VisitCallSite(ServiceCallSite callSite, TArgument argument)
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitConstructor(ConstructorCallSite constructorCallSite, RuntimeResolverContext context)
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor`2.VisitCallSiteMain(ServiceCallSite callSite, TArgument argument)
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitRootCache(ServiceCallSite callSite, RuntimeResolverContext context)
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor`2.VisitCallSite(ServiceCallSite callSite, TArgument argument)
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitIEnumerable(IEnumerableCallSite enumerableCallSite, RuntimeResolverContext context)
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor`2.VisitCallSiteMain(ServiceCallSite callSite, TArgument argument)
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitRootCache(ServiceCallSite callSite, RuntimeResolverContext context)
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor`2.VisitCallSite(ServiceCallSite callSite, TArgument argument)
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.Resolve(ServiceCallSite callSite, ServiceProviderEngineScope scope)
   at Microsoft.Extensions.DependencyInjection.ServiceProvider.CreateServiceAccessor(ServiceIdentifier serviceIdentifier)
   at System.Collections.Concurrent.ConcurrentDictionary`2.GetOrAdd(TKey key, Func`2 valueFactory)
   at Microsoft.Extensions.DependencyInjection.ServiceProvider.GetService(ServiceIdentifier serviceIdentifier, ServiceProviderEngineScope serviceProviderEngineScope)
   at Microsoft.Extensions.DependencyInjection.ServiceProvider.GetService(Type serviceType)
   at Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService(IServiceProvider provider, Type serviceType)
   at Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService[T](IServiceProvider provider)
   at Microsoft.Extensions.Hosting.Internal.Host.<StartAsync>d__15.MoveNext()
   at Microsoft.Extensions.Hosting.HostingAbstractionsHostExtensions.<RunAsync>d__4.MoveNext()
   at Microsoft.Extensions.Hosting.HostingAbstractionsHostExtensions.<RunAsync>d__4.MoveNext()
   at Microsoft.Extensions.Hosting.HostingAbstractionsHostExtensions.Run(IHost host)
   at Program.<Main>$(String[] args) in Program.cs:line 16

  This exception was originally thrown at this call stack:
    System.Uri.CreateThis(string, bool, System.UriKind, System.UriCreationOptions)
    System.Uri.Uri(string)
    System.UriBuilder.Uri.get()
    MassTransit.SqlHostAddress.implicit operator System.Uri(MassTransit.SqlHostAddress) in SqlHostAddress.cs
    MassTransit.SqlTransport.Configuration.ConfigurationSqlHostSettings.FormatHostAddress() in ConfigurationSqlHostSettings.cs
    System.Lazy<T>.ViaFactory(System.Threading.LazyThreadSafetyMode) in Lazy.cs
    System.Lazy<T>.ExecutionAndPublication(System.LazyHelper, bool) in Lazy.cs
    System.Lazy<T>.CreateValue() in Lazy.cs
    MassTransit.SqlTransport.Configuration.ConfigurationSqlHostSettings.HostAddress.get() in ConfigurationSqlHostSettings.cs
    MassTransit.SqlTransport.Configuration.SqlHostConfiguration.HostAddress.get() in SqlHostConfiguration.cs
    ...
    [Call Stack Truncated]

Inner Exception 1:
UriFormatException: Invalid URI: The hostname could not be parsed.
Link to repository that demonstrates/reproduces the issue
No response

Closing comment (2024-04-04T20:24:09Z): Duplicate: #5060
Test with the prerelease to confirm.