[Bug] Resizetizer assumes all projects use the same TFM version
- Dominant language
- C#
- Stars
- 23.3k
- Forks
- 2k
- Avg merge
- 1d 15h
- Merged PRs (30d)
- 290
Description
### Description
We had an issue in Resizetizer where it passes the TFM from the head project to the dependencies in order to try and locate assets. As a result the TFM that is specified in the dependency is never run and could potentially get missed. This was never noticed in the past as the previous collection target did not depend on anything and never ran anything but its own target. However, this just hid the underlying issue and could potentially just never returned anything.
After PR #1905, the MSBuild tasks changed a bit so that it expected the TFMs to be restored. But, since the TFM from the head project did not match the TFM in the dependency, it fails.
The correct fix is for the dependency project to somehow resolve the incoming TFM to match one of the one it has. Not sure how easy this is.
#### Workaround
A workaround would be for the library project to multi-target for bot hthe head project and the desired TFM.
The issue has a workaround where all the projects in the chain target the exact same TFM. However, this is not always viable since you may have a project that targets a lower TFM for compatibility reasons.
#### Logs
[Microsoft.Maui.WinUI-Debug.binlog.zip](https://github.com/dotnet/maui/files/6928054/Microsoft.Maui.WinUI-Debug.binlog.zip)
Contributor guide
Research direction
Start by inspecting the Resizetizer MSBuild targets and tasks, then review PR #1905 and the attached Microsoft.Maui.WinUI-Debug.binlog.zip. Reproduce the mismatch between the head project TFM and a dependency TFM; done means the dependency resolves against one of its supported TFMs instead of assuming the head project's TFM.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- csharp
- Domain
- build-system, tooling
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 38/100