Search code examples
c#.netvisual-studiomvvmnuget

VS2017 Pro v 15.9.53 c# .net 4.7.2 After Adding communitytoolkit.mvvm 8.1.0 to new wpf project, get warnings IDE0006 and MSBuild error


I am trying to learn how to use the Microsoft CommunityToolkit.mvvm for a work project. I am building the project via VS2017 Right click build, rebuild menu. I have limited knowledge of MSBuild.

I created a simple Wpf App, nothing but a mainwindow. Compiled with no errors.

Next, I added the CommunityToolKit.mvvm Stable version 8.1.0. Warnings were immediately generated.

  1. IDE0006 Error encountered while loading the project. Some project features, such as full solution analysis for the failed project and projects that depend on it, have been disabled.
  2. Invalid static method invocation syntax: "[MSBuild]::VersionLessThan($(MVVMToolkitCurrentCompilerVersion), 4.0)". Method '[MSBuild]::VersionLessThan' not found. Static method invocation should be of the form: $([FullTypeName]::Method()), e.g. $([System.IO.Path]::Combine(a, b)).

If I close and reopen the project, None of the project references can be found.

Searched for Invalid static method of invocation syntax on internet as well as communitytoolkit.mvvm issues. No searches were helpful given my limited knowledge of the ms build environment. Reviewd: https://developercommunity.visualstudio.com/t/update-to-1580-projects-wont-load/311136 my gacutil results show MSBuild items for 12, 4, 3.5, 2, but nothing for 15.x.

Any help is appreciated.


Solution

  • CommunityToolKit.mvvm doesn’t support any version of .NET Framework: https://www.nuget.org/packages/CommunityToolkit.Mvvm/#supportedframeworks-body-tab