.Net Framework 4.6 - Loading Crystal Reports - System.Web.Ui.Controls

Viewed 360

I'm testing out some very simple functionality with Crystal Reports in Visual Studio 2019. I've setup my project as a class library running .Net Framework 4.6. Reviewing past code of mine, every appears to be correct. However, I continue to fail on the simple function of creating a new ReportDocument() object. The error is that System.Web.UI.Control is missing. How do I add that for a .Net Framework 4.6 Class Library?

using CrystalDecisions.CrystalReports.Engine;

private void Start(string DocPath)
{
  ReportDocument CrystalReportDoc;
  CrystalReportDoc = new ReportDocument();
  CrystalReportDoc.Load(DocPath);
}

My error is at "new ReportDocument()"

I've installed Crystal Reports Integration for Visual Studio and the x86 and x64 runtimes. I'm referencing

  • CrystalDecisions.CrystalReports.Engine
  • CrystalDecisions.ReportSource
  • CrystalDecisions.Shared

My error when I get to the questionable line is

 Message: 
    System.TypeLoadException : Could not load type 'System.Web.UI.Control' from assembly 'System.Web, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'.
  Stack Trace: 
    No stack trace available
0 Answers
Related