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

VS Item Template Parameter rootnamespace returns incorrect value #345

Open
cdarrigo opened this issue Nov 19, 2021 · 0 comments
Open

VS Item Template Parameter rootnamespace returns incorrect value #345

cdarrigo opened this issue Nov 19, 2021 · 0 comments

Comments

@cdarrigo
Copy link

According to the documentation https://docs.microsoft.com/en-us/visualstudio/ide/template-parameters?view=vs-2022
the rootnamespace parameter should return the root namespace of the current project.

But it actually returns the full namespace to the current code file.

Example:

from my cs proj file:
<RootNamespace>SampleApplication</RootNamespace>

My Item Template Code:
using $rootnamespace$.Validators

When I use this item template to produce the new class in my SampleApplication.Commands folder, it SHOULD produce
using SampleApplication.Validators;

instead it produces
using SampleApplication.Commands.Validators;

This makes it impossible to write templates that reference any code outside the item's own namespace, and is inconsistent with the official documentation.

rootnamespace The root namespace of the current project. This parameter applies only to item templates.

using Visual Studio 2022

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant