asp.net-core-5.0fastreportvisual-studio-2022

FastReport.OpenSource.Data.MsSql can't reference FastReports.OpenSource


I have an existing ASP.NET Core 5 MVC app which is built with .Net 5 in VS2022. I added the nuGet packages FastReport.OpenSource.Web (2021.4.15), FastReport.OpenSource (2021.4.15) and FastReport.OpenSource.Data.MsSql (2021.4.0).

However, the following code fails to compile:

var webReport = new FastReport.Web.WebReport();
var mssql = new FastReport.Data.MsSqlDataConnection();
mssql.ConnectionString = _configuration.GetConnectionString("defaultConn"); //1
webReport.Report.Dictionary.Connections.Add(mssql);                         //2
webReport.Report.Load("report.frx");    

If I leave out lines 1 and 2, the program compiles and I can see the report. But with these lines included, I got a compile error:

Error CS0012: The type 'DataConnectionBase' is defined in an assembly that is not referenced. You must add a reference to assembly 'FastReport, Version=2021.4.0.0, Culture=neutral, PublicKeyToken=5ceb240df42bf6e8'.

However, FastReport.dll (which is FastReport.OpenSource), is included as a reference.

Detail of solution showing inclusion of FastReport

I'm implementing this from an example at dotnetthoughts where the author seems to have it working.

Is this because FastReports.dll is version 2021.4.15.0 but the error indicates it wants 2021.4.0.0 ??


Solution

  • FastReports has released a new version (2022.1) that has fixed this issue. Kudos to them for responding quickly.