You may see the following error message when you select Build or Rebuild after upgrading and updating the Nuget packages:
error CS1061: 'Message' does not contain a definition for 'PrimaryField' and no extension method 'PrimaryField' accepting a first argument of type 'Message' could be found (are you missing a using directive or an assembly reference?)
To resolve the problem, double click the error and type "_"(underscore) preceding the PrimaryField keyword in all the places where it is defined.