title: Invalid File Name error when loading lists from SharePoint 2013 with Client Object Model
body: <p>One of our clients gets an error from SharePoint (2013) with our tool when it tries to load the lists from the SharePoint site. Our tool uses the Client Object Model and it loads the lists with the following code:</p>
  
  <pre><code>context.Load(
      context.Web.Lists,
      coll =&gt;
      coll.Include(
          x =&gt; x.Id,
          x =&gt; x.Title,
          x =&gt; x.BaseType,
          x =&gt; x.BaseTemplate,
          x =&gt; x.TemplateFeatureId,
          x =&gt; x.Hidden,
          x =&gt; x.IsCatalog,
          x =&gt; x.HasExternalDataSource,
          x =&gt; x.RootFolder.ServerRelativeUrl,
          x =&gt; x.EnableVersioning,
          x =&gt; x.EnableMinorVersions,
          x =&gt; x.EnableModeration,
          x =&gt; x.ForceCheckout,
          x =&gt; x.EnableAttachments,
          x =&gt; x.DefaultViewUrl,
          x =&gt; x.SchemaXml));
  context.ExecuteQuery();
  </code></pre>
  
  <p>Basically, this code loads some properties from all the lists in the site. It works well with our environment as well as with all our other clients' environment. For some reason however, this client's SharePoint site returns the following error:</p>
  
  <blockquote>
    <p>ErrorCode=-2130575312
    ErrorMessage=Invalid file name. The file name you specified could not be used.  It may be the name of an existing file or directory, or you may not have permission to access the file.
    ErrorTypeName=Microsoft.SharePoint.SPException
    TraceCorrelationId=a0c66c9c-4950-0052-b533-fc908801a27a</p>
  </blockquote>
  
  <p>I have looked at the ULS logs and there is no entry with the above correlation ID. There is no error either around the time where the request was sent/processed (I checked everything from 30 seconds before the request to 30 seconds after the response). I have also confirmed that the user has access to the lists and that it is not a permission issue.</p>
  
  <p>I have searched around a bit and I have not found anything that could explain this error. Any ideas?</p>
  
  <p>UPDATE</p>
  
  <p>I have identified that the error only happens when loading the SchemaXml, it does not happen when it is not requested. I'm not sure why this would make it fail though.</p>
  
  <p>Thanks in advance!</p>