This is a migrated thread and some comments may be shown as answers.

Picturebox - Can't Use Resource File or System.Drawing.ImageConverter on design time

1 Answer 260 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Joseph
Top achievements
Rank 1
Joseph asked on 31 Mar 2020, 04:19 PM

Hey Guys, 

So I've got a .Net Core 2.1 MVC application that we have been using for a while now. We wanted to switch over some of the reports that we had in the application to using Telerik reports. I figured this wouldn't be an issue since I implemented this same basic logic inside of a winform application that we have.

So I added a Telerik Reporting R1 2020 project to the solution and created a report. When I try to add an image to the picturebox that I have on the report for the logo either through the ellipses on the picturebox properties or by setting the picturebox.Value to a resource file that I set I get an error saying 'Cannot read resources that depend on serialization.' 

I get this error as soon as I try to create a new Report object in my class. 

So I figured that I would set the value of the picturebox to an image that I would get from Image.FromFile("file path here"). After I do that, I get an error that says 'cannot load file or assembly System.Drawing.ImageConverter'. 

This error gets popped as soon as I try to render the report using ReportProcessor.RenderReport to render a pdf version of the report. 

Now I've tried adding the System.Drawing.Common and System.Drawing.Primative nuget packages to the .Net Core application with no prevail. 

Has anyone else ran into this problem or know how to get the image to set on the picturebox? My image type is a jpg. 

1 Answer, 1 is accepted

Sort by
0
Todor
Telerik team
answered on 03 Apr 2020, 08:03 AM

Hi Joseph,

I noticed that you have opened a support ticket for the same issue. I have replied there in detail. For the benefit of our community, I will post a summary also here.

From the description of the problem and the error, I suspect that the reports are in a ReportLibrary project referencing the .NET Framework. My tests confirm that the error is reproducible in such a scenario.

The solution is to move the code for the reports in a .NET Core or .NET Standard project.

Regards,
Todor
Progress Telerik

Progress is here for your business, like always. Read more about the measures we are taking to ensure business continuity and help fight the COVID-19 pandemic.
Our thoughts here at Progress are with those affected by the outbreak.
Tags
General Discussions
Asked by
Joseph
Top achievements
Rank 1
Answers by
Todor
Telerik team
Share this question
or