Skip to content

Conversation

Copilot
Copy link
Contributor

@Copilot Copilot AI commented Sep 25, 2025

Summary

Fixes the erroneous https:////aadB2CInstance.b2clogin.com/ default value displayed in the help output for the --aad-b2c-instance parameter in the blazorwasm template.

Problem

When running dotnet new blazorwasm -h, the --aad-b2c-instance parameter shows an invalid default URL with extra forward slashes:

--aad-b2c-instance <aad-b2c-instance>    The Azure Active Directory B2C instance to connect to (use with 
                                         IndividualB2C auth).
                                         Type: string
                                         Default: https:////aadB2CInstance.b2clogin.com/

The //// in the URL is clearly erroneous and confusing to users.

Root Cause

The AAdB2CInstance parameter in the template configuration only had a "replaces" property but no "defaultValue" property. This caused the template system to display the replacement value (which contains the erroneous ////) as the default in help text.

Solution

Added a "defaultValue": "https://aadB2CInstance.b2clogin.com/" property with the correct URL format to the AAdB2CInstance parameter configuration. This follows the same pattern used by the existing AADInstance parameter, which also has a similar issue with //// in its replaces value but shows the correct default because it has a proper defaultValue.

Result

The help output now correctly displays:

--aad-b2c-instance <aad-b2c-instance>    The Azure Active Directory B2C instance to connect to (use with 
                                         IndividualB2C auth).
                                         Type: string
                                         Default: https://aadB2CInstance.b2clogin.com/

Template creation and URL substitution continue to work correctly with both explicit parameter values and the default behavior.

Fixes #44669

Original prompt

This section details on the original issue you should resolve

<issue_title>Erroneous //// in default URL for a blazorwasm template parameter</issue_title>
<issue_description>### Is there an existing issue for this?

  • I have searched the existing issues

Describe the bug

This came up previously with an appsettings.json file, but I noticed it while exploring the parameters for the blazorwasm template, and I don't think that's been addressed yet.

image

It appears to me that this was unintentional. I have a fork and branch at the ready for a PR to fix this issue available here.

Expected Behavior

I expected a correct and valid URL format to be supplied as a default value that clearly requires one.

Steps To Reproduce

Repro:

  1. Install latest .NET SDK (Host: 6.0.10, SDK: 6.0.402 as of this issue)
  2. Execute dotnet new blazorwasm -h
  3. Scroll down to parameter --aad-b2c-instance
  4. Note the "Default" value of https:////aadB2CInstance.b2clogin.com/ verbatim and compare it to other default values on the screen.

Exceptions (if any)

No response

.NET Version

6.0.402

Anything else?

It's also worth noting that there's a similar issue with the "replaces" value at this line, but since it has a "defaultValue" also configured, the URL with the //// is not rendered to screen. I can fix that one, too, if you like, but figured I'd keep the commit focused.</issue_description>

<agent_instructions>The fix is to add a default value https://aadB2CInstance.b2clogin.com/ in https://github.com/dotnet/aspnetcore/blob/main/src/ProjectTemplates/Web.ProjectTemplates/content/ComponentsWebAssembly-CSharp/.template.config/template.json#L193-L198 so the UI doesn't show the value it replaces.</agent_instructions>

Comments on the Issue (you are @copilot in this section)

@ Thanks for contacting us. We're moving this issue to the `.NET 8 Planning` milestone for future evaluation / consideration. Because it's not immediately obvious that this is a bug in our framework, we would like to keep this around to collect more feedback, which can later help us determine the impact of it. We will re-evaluate this issue, during our next planning meeting(s). If we later determine, that the issue has no community involvement, or it's very rare and low-impact issue, we will close it - so that the team can focus on more important and high impact issues. To learn more about what to expect next and how this issue will be handled you can read more about our triage process [here](https://github.com/dotnet/aspnetcore/blob/main/docs/TriageProcess.md). @ Thanks for contacting us.

We're moving this issue to the .NET 9 Planning milestone for future evaluation / consideration. We would like to keep this around to collect more feedback, which can help us with prioritizing this work. We will re-evaluate this issue, during our next planning meeting(s).
If we later determine, that the issue has no community involvement, or it's very rare and low-impact issue, we will close it - so that the team can focus on more important and high impact issues.
To learn more about what to expect next and how this issue will be handled you can read more about our triage process here.</comment_new>
<comment_new>@
We've moved this issue to the Backlog milestone. This means that it is not going to be worked on for the coming release. We will reassess the backlog following the current release and consider this item at that time. To learn more about our issue management process and to have better expectation regarding different types of issues you can read our Triage Process.</comment_new>
<comment_new>@danmoseley
is this the kind of thing we should mark help wanted? or it needs design.</comment_new>
<comment_new>@javiercn
The relevant file is https://github.com/dotnet/aspnetcore/blob/main/src/ProjectTemplates/Web.ProjectTemplates/content/ComponentsWebAssembly-CSharp/wwwroot/appsettings.json</comment_new>

Fixes #44894

💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copy link
Contributor

Greetings human! You've submitted a PR that modifies code that is shared with https://github.com/dotnet/runtime . Please make sure you synchronize this code with the changes in that repo!

@Copilot Copilot AI changed the title [WIP] Erroneous //// in default URL for a blazorwasm template parameter Fix erroneous //// in default URL for blazorwasm --aad-b2c-instance parameter Sep 25, 2025
@Copilot Copilot AI requested a review from javiercn September 25, 2025 15:47
Copilot finished work on behalf of javiercn September 25, 2025 15:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants