Skip to content

MVVM Toolkit generators are broken on legacy style .csproj projects #540

@Sergio0694

Description

@Sergio0694

See: dotnet/roslyn#65996

Also probably related to: #495. The MVVM Toolkit generators are currently completely broken on legacy style .csproj projects:

"The legacy project build targets don't support Roslyn Component Versioning, so they just load everything under the analyzers node. If your source generator relies on this feature, you can update them to include a build target that reports an error if roslyn component versioning is not supported by the current build."

@sharwell can you elaborate on the part in bold? I'd like us to update the .targets file we're shipping in the generator so that if component version is not supported we can just remove one of the two analyzer references ourselves. This would allow us to keep leveraging the component versioning system to support older Roslyn versions while still having the performance improvements on new versions, and also to keep supporting customers using legacy style .csproj projects 🙂

Regression

Yes, 8.1 introduced this issue

Steps to reproduce

  1. Create a new UWP app
  2. Reference the MVVM Toolkit 8.1 Preview 1
  3. Try to build

Expected behavior

It should build normally

IDE and version

VS 2022

Nuget packages

  • CommunityToolkit.Common
  • CommunityToolkit.Diagnostics
  • CommunityToolkit.HighPerformance
  • CommunityToolkit.Mvvm (aka MVVM Toolkit)

Nuget package version(s)

8.1.0 Preview 1

Metadata

Metadata

Assignees

No one assigned

    Labels

    blocking release 💥A major issue that's blocking a release and has to be fixedbuild 🔥Some changes or issues related to build infrastructureexternal ⤴️Something related to or caused by an external projectmvvm-toolkit 🧰Issues/PRs for the MVVM Toolkitpriority 🚩An issue or change that has priority

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions