The core logic is the same but duplicated in these two methods: https://github.com/dotnet/aspire/blob/357a0b2e35b9188ba7c4437be3287b9b86388176/src/Aspire.Hosting.Testing/DistributedApplicationFactory.cs#L194-L218 https://github.com/dotnet/aspire/blob/357a0b2e35b9188ba7c4437be3287b9b86388176/src/Aspire.Hosting/LaunchProfileExtensions.cs#L55-L95 context: https://github.com/dotnet/aspire/pull/5218#issuecomment-2274444437