Behavior change from .NET Core SDK 3.0.101 to 3.1.100 when generating MenuItems in WPF
- Dominant language
- C#
- Stars
- 7.7k
- Forks
- 1.3k
- Avg merge
- 1d 11h
- Merged PRs (30d)
- 61
Description
I write a WPF app targeting .NET Framework 4.7.2 and added a `global.json` to control which version of dotnet CLI tools to be used in building and deploying.
In this app I define a menu of `MenuItems` of which some contain `MenuItems` as their children (a submenu). In one place I set the `UsesItemContainerTemplate`-property of the parent to `true` and define an `ItemContainerTemplate` containing a `MenuItem` at the root. As expected the parents `ItemContainerGenerator` respects this template and does not generate a menu item around this parents children.
After I switched the SDK version in `global.json` from `3.0.101` to `3.1.100` I noticed that this behavior changed. My submenuitems now are wrapped into an extra `MenuItem`.
I created a super-simple example-app that reproduces this issue. It can be found [in this GitHub repo](https://github.com/davikor/menu-item-display-bug.git) alongside with screenshots of the issue.
After checkout you can build and run this project in VS16.5 and it will behave as (I) expect it. Then you can change the SDK version in global.json to 3.1.100 and rebuild it in VS. When you run it now, you will see the unexpected result.
On a side note: When running dotnet clean/run from the console, the unexpected behavior always occurs, regardless of the SDK version defined in `global.json`. Unfortunately my knowledge of the dotnet / MSBuild system is not sufficient to further investigate here.
Also, I am not 100% sure whether this is the right place to post this issue. If there is a place better suited for my issue, please let me know and I will move this issue.
Contributor guide
Assessment
This issue has not been assessed yet.