title: Non-invocable member 'File' cannot be used like a method while generating Reports
body: <p>I used a method for generating report in my previous project and tried to use the same method in the new project. However, I encounter <strong><em>"Non-invocable member 'File' cannot be used like a method"</em></strong> error and File cannot be recognized. By looking at the references of file, it seems to be <code>FileContentResult Controller.File()</code> in the previous project, but <code>System.IO.File()</code> in the new project (even if I remove using System.IO; from the references lines, I encounter <strong>"The name 'File' does not exist in the current context"</strong> error). Any idea to fix the problem?</p>
  
  <pre><code>public static FileResult GenerateReport()
  {
      EmployeeTableAdapter ta = new EmployeeTableAdapter();
      EmployeeDS ds = new EmployeeDS();
  
      ds.Employee.Clear();
      ds.EnforceConstraints = false;
  
      ta.Fill(ds.Employee);
  
      ReportDataSource rds = new ReportDataSource();
      rds.Name = "ReportingDataSet";
      rds.Value = ds.Employee;
  
      ReportViewer rv = new Microsoft.Reporting.WebForms.ReportViewer();
      rv.ProcessingMode = ProcessingMode.Local;
      rv.LocalReport.ReportPath = System.Web.HttpContext.Current.                                 
          Server.MapPath("~/Reporting/Employee.rdlc");
      rv.LocalReport.EnableHyperlinks = true;
      rv.LocalReport.EnableExternalImages = true;
  
      // Add the new report datasource to the report.
      rv.LocalReport.DataSources.Add(rds);
      rv.LocalReport.EnableHyperlinks = true;
      rv.LocalReport.Refresh();
  
      byte[] streamBytes = null;
      string mimeType = "";
      string encoding = "";
      string filenameExtension = "";
      string[] streamids = null;
      Warning[] warnings = null;
  
      streamBytes = rv.LocalReport.Render("PDF", null, out mimeType, out 
          encoding, out filenameExtension, out streamids, out warnings);
  
      return File(streamBytes, mimeType, "Application" + "_" + ".pdf");
  }
  </code></pre>
  
  <p><br/>
  <strong>Note:</strong> I use MVC5 and SQL Server.</p>