Please refer to Introduction to PnP Core Component for more details. I have created a console application and added SharePointPnPCoreOnline NuGet package for the SharePoint 2016 version.
Code Snippet
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Net;
  5. using System.Text;
  6. using System.Threading.Tasks;
  7. using Microsoft.SharePoint.Client;
  8. using OfficeDevPnP.Core;
  9. namespace SP2016PnPCoreComponentDemo
  10. {
  11. class Program
  12. {
  13. static void Main(string[] args)
  14. {
  15. // Input Parameters
  16. string siteUrl = "http://c7395723754:35298/sites/VijaiDemo";
  17. string userName = "administrator";
  18. string password = "xxxxxxxx";
  19. string domain = "AD2012";
  20. string listName = "PnP Custom List";
  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. // Create a custom list using CSOM Extension Method
  28. ctx.Web.CreateList(ListTemplateType.GenericList, listName, false, true, "", true);
  29. }
  30. }
  31. catch (Exception ex)
  32. {
  33. Console.WriteLine("Error Message: " + ex.Message);
  34. }
  35. }
  36. }
  37. }