Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Check if a custom namespace has been specified when generating the Settings designer class. #9174

Merged
merged 2 commits into from
Jul 18, 2023

Conversation

melytc
Copy link
Contributor

@melytc melytc commented Jul 18, 2023

Fixes:
https://devdiv.visualstudio.com/DevDiv/_workitems/edit/1708985
https://devdiv.visualstudio.com/DevDiv/_workitems/edit/1845024

We got a couple of feedback tickets around VB projects having their namespace wrongly generated to the My namespace on the Settings.Designer.vb file, instead of their custom namespace.

Back in 2022, we added some logic to the SettingsSingleFileGeneratorBase.vb to include the My namespace if the project was VB; we forgot to include a consideration for custom namespaces, which would be found in the DefaultNamespace parameter when calling Create.

Microsoft Reviewers: Open in CodeFlow

…onsider the DefaultNamespace parameter if it's not empty. This would fix the scenario where the user has a custom namespace set up and will generate the correct code in the Settings.Designer.vb file.
Simplify name, simplify variable creation and use an explicit string comparison.
@melytc melytc added Bug Feature-Settings-Designer Specific to the settings file designer. labels Jul 18, 2023
@melytc melytc requested a review from a team as a code owner July 18, 2023 16:15
@melytc melytc changed the title Settings generator fix Check if a custom namespace has been specified when generating the Settings designer class. Jul 18, 2023
@melytc melytc added this to the 17.8 milestone Jul 18, 2023
@melytc melytc merged commit badafa1 into dotnet:main Jul 18, 2023
5 checks passed
@melytc melytc deleted the settings-generator-fix branch July 18, 2023 20:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature-Settings-Designer Specific to the settings file designer.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants