Issue adding a data source with Microsoft RDLC Report Designer in a C# WinForms app under .Net 8.0

I am trying to add some basic reporting into a .Net 8.0 C# WinForms app using the Microsoft RDLC Report Designer and the ReportViewerCore.WinForms nuget package, and have found myself running into a number of issues.

Does anyone have any experience of getting this to work, and getting past these problems?

The steps I have undertaken so far are:

  • Install the Microsoft RDLC Report Designer extension (17.0.0) into Visual Studio Enterprise 2022 (17.10.0)
  • Install the ReportViewerCore.WinForms nuget package (15.1.19) into my WinForms project (this required me to first install Microsoft.CodeAnalysis.Common v4.8.0, which is not the current version)
  • Add a new report into the WinForms project
  • In the “Report Data” window, select the “New” dropdown, and “Dataset…”
  • Select “Object” in the “Choose a Data Source Type” dialog
  • Select a model class from my business model project. Note that, at this point, no classes from the same assembly (my WinForms assembly) are listed, however, this is not an issue for me.
  • When picking any class as an object data source, I am presented with the following unhelpful error message:

enter image description here

  • In order to try to determine whether it is something I have done specifically with my model classes that is causing the issue, I then created a fresh solution, with nothgin other than a winforms project and a class library project, and repeated this process, creating an absolutely basic POCO class with one int property. this had the same issue. However, I found that if I extracted an interface for that class, and chose the interface as the data source, then this would work. I then tried this in my original solution, and again, this worked:
Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
<code> public class Class1 : IClass1
{
public int MyProperty { get; set; }
}
</code>
<code> public class Class1 : IClass1 { public int MyProperty { get; set; } } </code>
 public class Class1 : IClass1
 {
     public int MyProperty { get; set; }
 }
Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
<code> public interface IClass1
{
int MyProperty { get; set; }
}
</code>
<code> public interface IClass1 { int MyProperty { get; set; } } </code>
 public interface IClass1
 {
     int MyProperty { get; set; }
 }
  • Having found that extracting the interface for a class seems to work I then did the same for one of my more complex model classes, and attempted to add this as a data source. I then get the following error (class name redacted):

enter image description here

  • I then went back to my simple Class1 class, added a string property to it, recompiled, and attempted to remove and re-add this as a data source, tog et the same error here.

My conclusion is that there seems to be some sort of issue with the report designer being able to determine the CLR types in the class, extracting an interface goes some way towards mitigating this, but the underlying problem could be that the designer, specifically the “Data Source Configuration Wizard” appears to be trying to use the wrong version of the System.Runtime assembly.

I’ve tried to work out whether dropping the correct system runtime DLL into the installation folder for the extension would work to solve this, but have been stymied by being unable to work out where the extension has actually been installed, and also which DLL I should copy into this location, if I can work out where to put it.

Searching here for this problem shows that others have had a similar issue in the past, but I can’t find any solution that solves my specific issue. I have also tried using the older versions of the ReportViewer nuget packages, targeting .Net Framework, and these give me the exact same results.

If I have to extract interfaces for any POCOs I want to use for reports, I can live with this. However, if I am unable to use any complex types (such as objects that contain lists of other objects) for reporting, this will be a show-stopper.

Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa Dịch vụ tổ chức sự kiện 5 sao Thông tin về chúng tôi Dịch vụ sinh nhật bé trai Dịch vụ sinh nhật bé gái Sự kiện trọn gói Các tiết mục giải trí Dịch vụ bổ trợ Tiệc cưới sang trọng Dịch vụ khai trương Tư vấn tổ chức sự kiện Hình ảnh sự kiện Cập nhật tin tức Liên hệ ngay Thuê chú hề chuyên nghiệp Tiệc tất niên cho công ty Trang trí tiệc cuối năm Tiệc tất niên độc đáo Sinh nhật bé Hải Đăng Sinh nhật đáng yêu bé Khánh Vân Sinh nhật sang trọng Bích Ngân Tiệc sinh nhật bé Thanh Trang Dịch vụ ông già Noel Xiếc thú vui nhộn Biểu diễn xiếc quay đĩa Dịch vụ tổ chức tiệc uy tín Khám phá dịch vụ của chúng tôi Tiệc sinh nhật cho bé trai Trang trí tiệc cho bé gái Gói sự kiện chuyên nghiệp Chương trình giải trí hấp dẫn Dịch vụ hỗ trợ sự kiện Trang trí tiệc cưới đẹp Khởi đầu thành công với khai trương Chuyên gia tư vấn sự kiện Xem ảnh các sự kiện đẹp Tin mới về sự kiện Kết nối với đội ngũ chuyên gia Chú hề vui nhộn cho tiệc sinh nhật Ý tưởng tiệc cuối năm Tất niên độc đáo Trang trí tiệc hiện đại Tổ chức sinh nhật cho Hải Đăng Sinh nhật độc quyền Khánh Vân Phong cách tiệc Bích Ngân Trang trí tiệc bé Thanh Trang Thuê dịch vụ ông già Noel chuyên nghiệp Xem xiếc khỉ đặc sắc Xiếc quay đĩa thú vị
Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa
Thiết kế website Thiết kế website Thiết kế website Cách kháng tài khoản quảng cáo Mua bán Fanpage Facebook Dịch vụ SEO Tổ chức sinh nhật