title: C# Overload Error Message
body: <p>So I've been trying to use this piece of code below to try and upload an image into the SharePoint image library.</p>
  
  <pre><code>static NetworkCredential credentials = new NetworkCredential(username, password, domain);
  static ClientContext clientContext = new ClientContext(siteURL);
  static Web site = clientContext.Web;
  static List list = site.Lists.GetByTitle("Site Images");
  
  private static byte[] StreamFile(string filename)
  {
      FileStream fs = new FileStream(filename, FileMode.Open, FileAccess.Read);
      // Create a byte array of file stream length
      byte[] ImageData = new byte[fs.Length];
      //Read  block of bytes from stream into the byte array
      fs.Read(ImageData, 0, System.Convert.ToInt32(fs.Length));
      //Close the File Stream
      fs.Close();
      return ImageData;
  }
  
  
  private static void uploadImage()
  {
      String fileName = "Sunset";
      String filePath = "C://Documents and Settings//Desktop//Sample Extracted Pic.jpeg";
  
      list.RootFolder.Files.Add(fileName, StreamFile(filePath));
  }
  </code></pre>
  
  <p>...And everything seems fine (at least within the compiler), until you get to: <code>list.RootFolder.Files.Add(fileName, StreamFile(fileName));</code></p>
  
  <p>The compiler returns an error saying <code>No overload for method 'Add' takes 2 arguments</code>, and I understand what it's saying, but I have no idea why I am getting that error. Does anyone have any idea or proposed solutions? All feedback is appreciated.</p>