Open david-maw opened 2 years ago
I'm asking around about this internally. No guarantees, but I'd like to prevent item templates from editing the project file.
When this happens, it triggers some MSBuild targets to run in the Android workload, so it would help build performance to fix this -- and a weird bug, too.
As far as I can tell they don't need to add MauiXml nodes, but I suppose it makes sense to do something to trigger a build when files are added to the project.
@david-maw you don't actually need the %(Generator)
at all, because MAUI uses Roslyn source generators for things like x:Name
, you get valid intellisense without the need for a design-time build.
It looks like this can only be fixed by the Xamarin/MAUI extension in Visual Studio, by adding a provider like this for .xaml
files:
(sorry MS-private link)
Verified this on Visual Studio Enterprise 17.6.0 Preview 7.0. Repro on Windows 11 with below Project: MauiApp3.zip
This node will be for the newly added page, there's not one for MainPage or AppShell (the other two XAML defined pages).
@XamlTest this can only be fixed by a change in Visual Studio, as we tried to file on a private ticket here: https://devdiv.visualstudio.com/DevDiv/_workitems/edit/1713708
If others are wanting this change, please upvote or comment. Thanks!
@jonathanpeppers Thanks for the note, we're just doing a bulk re-triage of issues to see if latest changes affected the behavior at all.
I see the internal issue was marked as "Cut". Not sure if that was because it was fixed in another way, or we should re-open?
I am not near my Windows machine right now, but we will have to re-verify.
We've added this issue to our backlog, and we will work to address it as time and resources allow. If you have any additional information or questions about this issue, please leave a comment. For additional info about issue management, please read our Triage Process.
Verified this issue with Visual Studio Enterprise 17.8.0 Preview 7.0. This issue also repro.
Description
When you create a new MAUI project it will contain AppShell.xaml and MainPage.xaml and corresponding.cs files. These will not be explicitly called out in the project file.
But when you add each new page it will cause the project file to be updated with a MauiXaml node in an ItemGroup. Deleting this new ItemGroup seems to make no practical difference and having it present makes for (trivial) conflicts when multiple changes to the same project need to be reconciled.
I'm not sure this rises to the level of a bug, but it is strange, do these nodes have a purpose, in which case why are there none for AppShell and MainPage?
Steps to Reproduce