Uno.Wasm.Bootstrap.targets is causing broken dependencies to be shown in Visual Studio
(Discovered while investigating https://developercommunity.visualstudio.com/t/Yellow-Triangles-on-Frameworks-have-no-c/1539610)
Visual Studio's "Dependencies" tree works in two phases:
- Evaluate the project (without running any targets) to find all dependencies (various kinds of reference) in the project
- Run an internal "design-time" build (running targets) to determine which dependencies actually resolve, and which don't
Further:
- If a reference item is present in step 1 but not step 2, we show a yellow triangle.
- If a reference item is present in step 2 but not step 1, we don't show it in the tree at all.
In the case of Uno.Wasm.Bootstrap, the set of reference items is being modified in a target:
- The
Microsoft.AspNetCore.Appframework is removed, leading to a yellow triangle per the above. - The
Microsoft.Windows.Compatibilitypackage is added, leading to it not being displayed in the UI per the above.
Looking at the WasmBootstrapAdjustFrameworkReference target, I don't see why it must be a target:
https://github.com/unoplatform/Uno.Wasm.Bootstrap/blob/195a908a1ead3d23df6fceaf283461deae0a885e/src/Uno.Wasm.Bootstrap/build/Uno.Wasm.Bootstrap.targets#L81-L95
Could this just be a top-level PropertyGroup and ItemGroup? If so, the VS experience will work as designed.
Note that this issue does not influence the actual build. Only the presentation in VS.
Thanks for the investigation! As far as I remember, this is done through a target because of the evaluation ordering for framework references when done through "sdk" inclusion. We will revisit this to see if this can be removed/changed.
This is also partially mentioned in #423