Posted 12 January 2022, 2:14 am EST
Hello,
We are currently in the process of updating all our software to either .Net 5.0 or 6.0 . During this process we have ran into an issue concering the rendering of reports in one of our APIs.
We used to use the C1Report assembly to render with .RenderToStream and return a stream of the generated PDF file. We have since replaced this with the latest Flexreport package(C1.Win.FlexReport 5.0.20213.537) but the following line of code gives an exception:
var report = new C1.Win.FlexReport.C1FlexReport();
This gives the following exception:
System.Reflection.ReflectionTypeLoadException: 'Unable to load one or more of the requested types.
Could not load file or assembly 'System.Windows.Forms.Design, Version=5.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'. Het systeem kan het opgegeven bestand niet vinden....
The same issue is also happening when we make a test project in .Net 6.0 and add the same package and line of code there.
It seems that this package requires several winforms assemblies which are not available in the WebAPI. Is there any other way for us to render? Have we missed a specific web package that might be used?