title: Using SharePoint CSOM inside .Net Core application
body: <p>I want to get data from SharePoint list by CSOM library on .Net Core MVC application. There are absolutely no problem to achieve that on .Net Framework aplication because Microsoft.SharePoint.Client library contains ExecuteQuery method. Unfortunately .Net Core equivalent not. </p>
  
  <p>I've made Async function</p>
  
  <pre><code>public async Task&lt;ActionResult&gt; GetRequests()
      {
          ClientContext context = new ClientContext("https://xxx/sites/xxx/");
          List certificatesList = context.Web.Lists.GetByTitle("Items");
          CamlQuery query = CamlQuery.CreateAllItemsQuery(100);
          ListItemCollection items = certificatesList.GetItems(query);
          context.Load(items);
          Task spTask = context.ExecuteQueryAsync();
          await Task.WhenAll(spTask);
          var result = items;
          ...
  
      }
  </code></pre>
  
  <p>but it seems like it also won't work on .Net Core because it throws </p>
  
  <blockquote>
    <p>Exception thrown: 'System.InvalidOperationException' in >System.Private.CoreLib.ni.dll</p>
    
    <p>Additional information: Cannot find platform service library. For
    Windows Store application, please include
    Microsoft.SharePoint.Client.Runtime.WindowsStore.dll in the
    application package. For Windows Phone application, please include
    Microsoft.SharePoint.Client.Runtime.WindowsPhone.dll in the
    application package. For Windows application, please install
    Microsoft.SharePoint.Client.Runtime.Windows.dll in the GAC (Global
    Assembly Cache) or make it available for the Windows application.</p>
  </blockquote>
  
  <p>Does someone use CSOM in .Net Core or should I use REST Api instead?</p>
  
  <pre><code>  "frameworks": {
      "netcoreapp1.0": {
        "imports": [
          "dotnet5.6",
          "portable-net45+win8"
        ]
      }
    }
  </code></pre>