[release/10.0] Backport fixes to templates derived *.dev.localhost hostnames in launch profiles#65048
Merged
wtgodbe merged 2 commits intorelease/10.0from Jan 14, 2026
Conversation
…64988) * Initial plan * Add DNS-safe hostname forms and symbols to templates Co-authored-by: DamianEdwards <249088+DamianEdwards@users.noreply.github.com> * Add trimming of leading/trailing hyphens for DNS-safe hostnames Co-authored-by: DamianEdwards <249088+DamianEdwards@users.noreply.github.com> * Use distinct placeholder LocalhostTldHostNamePrefix for hostname replacement Co-authored-by: DamianEdwards <249088+DamianEdwards@users.noreply.github.com> * Add tests for DNS-compliant hostname generation with --localhost-tld Co-authored-by: DamianEdwards <249088+DamianEdwards@users.noreply.github.com> * Add tests for DNS-compliant hostname generation in Blazor templates Co-authored-by: DamianEdwards <249088+DamianEdwards@users.noreply.github.com> * Move VerifyDnsCompliantHostname to shared Project class Co-authored-by: DamianEdwards <249088+DamianEdwards@users.noreply.github.com> * Fix -n parameter conflict and add tests with numbers in project names Co-authored-by: DamianEdwards <249088+DamianEdwards@users.noreply.github.com> * Refactor DNS hostname tests to use Theory with InlineData Co-authored-by: DamianEdwards <249088+DamianEdwards@users.noreply.github.com> * Fix razorcomponent item test --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: DamianEdwards <249088+DamianEdwards@users.noreply.github.com> Co-authored-by: Damian Edwards <damian@damianedwards.com>
BrennanConroy
approved these changes
Jan 14, 2026
wtgodbe
approved these changes
Jan 14, 2026
Member
|
Approved over email |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Backport fixes to templates derived *.dev.localhost hostnames in launch profiles
Backports fixes to the empty and blazor web templates that ensure that host name prefixes generated for new projects that opt-in to the
--localhost-tldoption don't violate RFC 952/1123.Description
The template/tooling generates DNS names (e.g., hostnames or domain labels) that contain underscores (_) when the user opts-in to the
--localhost-tldtemplate option and the project name includes characters that are invalid in a C# class name. According to DNS hostname specifications (RFC 952 and RFC 1123), underscores are not valid characters in hostnames. This causes failures in environments and libraries that strictly validate DNS names (e.g., Kubernetes, Docker, cloud DNS, and DNS client libraries).Fixes #64978
Customer Impact
Currently when opting in to using
*.dev.localhosthost names for a new project using the empty or blazor web project templates, depending on the name given to the project the generated host name prefix used in the project launch profiles may violate rules in RFC 952/1123 which can lead to it causing errors or being rejected in other systems during local development, e.g.:xn--and is followed by characters that would make it an invalid IDN name.The generated host name can be edited directly in the project's
Properties/launchSettings.jsonfile to workaround this issue once the project is created.Regression?
The option was newly added in .NET 10 and has had this behavior since its inclusion.
Risk
Change to the template declared symbols and transforms only using established templating system capabilities.
Verification
Unit tests are included.
Packaging changes reviewed?