-
Notifications
You must be signed in to change notification settings - Fork 10.2k
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Adding a cshtml file to a Blazor project results in multiple item groups getting added to the project file #16383
Comments
Yeah, it's not good if this is happening because it means that the item is going to be excluded from compilation. |
Is it possible in this case that you renamed the file? I've seen this kind of thing happen when you rename a file to have some other file extension and then back to |
Not in this particular case. The repro steps are exactly as listed above. |
I do see other oddities in the csproj file though when I copy an existing cshtml file within the same project and then rename it. |
@SteveSandersonMS Can we get someone to take a look and figure out what is going on here? |
Seeing this as well. |
OK thanks for the bump on this. I know it's annoying 😢. |
This change should hopefully end the MSBuild craziness that happens when you add a file to the project using the VS Add Item dialog. VS apparently has a behavior that intentionally tries to make sure the added file is only included in a single itemgroup. So when Blazor defines an itemgroup at the top level of scope with the same members as Content - VS does some gymnastics to prevent it working. The workaround is to defer the initialization of our itemgroup.
This change should hopefully end the MSBuild craziness that happens when you add a file to the project using the VS Add Item dialog. VS apparently has a behavior that intentionally tries to make sure the added file is only included in a single itemgroup. So when Blazor defines an itemgroup at the top level of scope with the same members as Content - VS does some gymnastics to prevent it working. The workaround is to defer the initialization of our itemgroup.
This should be fixed now in dev, and will be part of 0.4 |
This change should hopefully end the MSBuild craziness that happens when you add a file to the project using the VS Add Item dialog. VS apparently has a behavior that intentionally tries to make sure the added file is only included in a single itemgroup. So when Blazor defines an itemgroup at the top level of scope with the same members as Content - VS does some gymnastics to prevent it working. The workaround is to defer the initialization of our itemgroup.
VSIX version: 15.6.10124
Repro steps:
Expected result:
Actual result:
The text was updated successfully, but these errors were encountered: