Please refer to the Introduction to PnP Core Component and OfficeDevPnP.Core for more details. I have created a console application and added SharePointPnPCore2016 NuGet package for the SharePoint 2016 version.
Code Snippet
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6. using Microsoft.SharePoint.Client;
  7. using OfficeDevPnP.Core;
  8. using OfficeDevPnP.Core.Extensions;
  9. using Microsoft.SharePoint.Client.Taxonomy;
  10. namespace SP2016PnPCoreComponentDemo
  11. {
  12. class Program
  13. {
  14. static void Main(string[] args)
  15. {
  16. // Input Parameters
  17. string siteUrl = "http://c7395723754/";
  18. string userName = "administrator";
  19. string password = "Mf165Nz2WV";
  20. string domain = "AD2012";
  21. OfficeDevPnP.Core.AuthenticationManager authMgr = new OfficeDevPnP.Core.AuthenticationManager();
  22. try
  23. {
  24. // Get the client context
  25. using (var ctx = authMgr.GetNetworkCredentialAuthenticatedContext(siteUrl, userName, password, domain))
  26. {
  27. // Get default keywords Term Store
  28. TermStore defaultKeyTermStore = ctx.Site.GetDefaultKeywordsTermStore();
  29. Console.WriteLine(defaultKeyTermStore.Name);
  30. Console.ReadLine();
  31. }
  32. }
  33. catch (Exception ex)
  34. {
  35. Console.WriteLine("Error Message: " + ex.Message);
  36. }
  37. }
  38. }
  39. }