title: How to fix 'Value cannot be null. Parameter name: key' exception using CSOM in SharePoint Online
body: <p>I trying to retrieve some data from a SharePoint Online site using C#. I have two different SharePoint sites (like site1.sharepoint.com and site2.sharepoint.com). I use the same code to retrieve date and I can retrieve from site1.sharepoint.com and works perfectly, but I cannot retrieve from site2.sharepoint.com.</p>
  
  <p>The site1 is our organization tenant, which means security settings were changed, meanwhile site2 is default(no setting has been changed since it was created).</p>
  
  <p>Can the problem be to the site1? If yes, which settings could generate such error?</p>
  
  <p>Thank you</p>
  
  <pre><code>    private async Task&lt;ListItemCollection&gt; GetIntentFilterData(string url, string content, string columnName, string columnValue)
      {
          string siteUrl = url;
  
          string login = _configuration["Login"];
          string password = _configuration["Password"];
  
          string listName = content;
  
          try
          {
  
              using (ClientContext clientContext = new ClientContext(siteUrl))
              {
  
                  clientContext.Credentials = new SharePointOnlineCredentials(login, password);
  
                  List oList = clientContext.Web.Lists.GetByTitle(listName);
                  CamlQuery camlQuery = new CamlQuery();
                  camlQuery.ViewXml = string.Format(@"&lt;View&gt;                              
                                                      &lt;Query&gt; 
                                                      &lt;Where&gt;
                                                      &lt;Contains&gt;                                                        
                                                      &lt;FieldRef Name='BaseName'/&gt;                                        
                                                      &lt;Value Type='Lookup'&gt;" + columnValue + @"&lt;/Value&gt;                                                                                            
                                                      &lt;/Contains&gt;                                                                                                            
                                                      &lt;FieldRef Name='EncodedAbsUrl'/&gt;                                           
                                                      &lt;Value Type='Lookup'&gt;" + columnValue + @"&lt;/Value&gt;                                                                                                                                                  
                                                      &lt;/Where&gt;                                
                                                      &lt;/Query&gt;                                                    
                                                      &lt;/View&gt;", "Some specific item");
  
                  ListItemCollection collListItem = oList.GetItems(camlQuery);
                  clientContext.Load(collListItem, items =&gt; items.Include(item =&gt; item["EncodedAbsUrl"], item =&gt; item["BaseName"]));
  
                  await clientContext.ExecuteQueryAsync(); // this line throws the exception.
                  return collListItem;
              }
          }
          catch (Exception e)
          {
              // The error is "Value cannot be null.\r\nParameter name: key"
              throw;
          }
      }
  </code></pre>
  
  <p>I am expecting the same result I get form the site2 (a list of files).
  The result I am getting now is  </p>