FileNotFoundException occured while assign DataSource in CrystalReport

c#, crystal-reports, filenotfoundexception, visual-studio-2013

Solution

Try again after adding below section in your config:

<startup uselegacyv2runtimeactivationpolicy="true">
  <supportedruntime version="v4.0" />
</startup>

Problem

System.IO.FileNotFoundException execption thrown while assigning data source in report. I am using visual studio 2013, C# 4.5, WinForm application. I have installed crystal report for visual studio 13. This is code ``` DataSet ds = new DataSet(); ds.Tables.Add(new DataTable("administration_CashDeskManager_Reports_ReportDataBusinessObject")); ds.Tables.Add(new DataTable("administration_CashDeskManager_Reports_ReportDataDetailBusinessObject")); Reports.CrystalReport.rptCashDeskTransactionLog Report = new Reports.CrystalReport.rptCashDeskTransactionLog(); Report.SetDataSource(ds); crViewer.ReportSource = Report; ``` Error thrown on Report.SetDataSource(ds) command. I think this error is version specific error. Exception detail : An unhandled exception of type 'System.IO.FileNotFoundException' occurred in mscorlib.dll Additional information: Could not load file or assembly 'file:///C:\Program Files\SAP BusinessObjects\Crystal Reports for .NET Framework 4.0\Common\SAP BusinessObjects Enterprise XI 4.0\win32_x86\dotnet1\crdb_adoplus.dll' or one of its dependencies. The system cannot find the file specified.

Original source