Mulititarget runtime exception in TeeChart ctr in net6-windows

TeeChart for Microsoft Visual Studio .NET, Xamarin Studio (Android, iOS & Forms) & Monodevelop.
Post Reply
cfm_applied
Newbie
Newbie
Posts: 5
Joined: Fri Jun 28, 2024 12:00 am

Mulititarget runtime exception in TeeChart ctr in net6-windows

Post by cfm_applied » Fri Aug 16, 2024 12:35 am

Hello,

I have a C# proj that has 2 targets net.6-windows and net4.7.2.

When I run the app for net.6-windows I got the following exception:
System.IO.FileNotFoundException: Could not load file or assembly 'System.Text.Json, Version=7.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51'. The system cannot find the file specified.
File name: 'System.Text.Json, Version=7.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51'
at Steema.TeeChart.Export.TemplateExport..ctor(Chart chart)
at Steema.TeeChart.Export.Exports.get_Template()
at Steema.TeeChart.Export.Exports.rif(TChart blu)
at Steema.TeeChart.TChart.rfc()
at Steema.TeeChart.TChart..ctor()

Here are some packages used:
<PackageVersion Include="System.Text.Json" Version="8.0.4" />
<PackageVersion Include="SixLabors.ImageSharp" Version="3.1.5" />
<PackageVersion Include="SixLabors.ImageSharp.Drawing" Version="2.1.4" />
<PackageVersion Include="PdfSharpCore" Version="1.3.65" />
<PackageVersion Include="Steema.TeeChart.NET" Version="4.2024.7.29" />

App built for net 4.7.2 does not have this issue.

Thanks,
Konstantin.

Edu
Newbie
Newbie
Posts: 39
Joined: Tue Nov 28, 2023 12:00 am

Re: Mulititarget runtime exception in TeeChart ctr in net6-windows

Post by Edu » Fri Aug 16, 2024 9:38 am

Hello Konstantin,

Please make sure that licenses.licx has no content (delete any auto-generated line refrerring to TeeChart) but be sure that the project has the teechart.licenses file included as an embedded resource.

You can find more info here about installing licenses and more.

If the issue persists, please don't hesitate to contact us again. We are here to help and will be happy to assist you further.

Regards,
Edu
Edu
Steema Support

cfm_applied
Newbie
Newbie
Posts: 5
Joined: Fri Jun 28, 2024 12:00 am

Re: Mulititarget runtime exception in TeeChart ctr in net6-windows

Post by cfm_applied » Fri Aug 16, 2024 5:34 pm

Hi Edu,

Thank you response.

That topic is not about licx file. I have an exception: System.IO.FileNotFoundException at runtime for net6-windows targeted app.

Thanks,
Konstantin.


Edu wrote:
Fri Aug 16, 2024 9:38 am
Hello Konstantin,

Please make sure that licenses.licx has no content (delete any auto-generated line refrerring to TeeChart) but be sure that the project has the teechart.licenses file included as an embedded resource.

You can find more info here about installing licenses and more.

If the issue persists, please don't hesitate to contact us again. We are here to help and will be happy to assist you further.

Regards,
Edu

Edu
Newbie
Newbie
Posts: 39
Joined: Tue Nov 28, 2023 12:00 am

Re: Mulititarget runtime exception in TeeChart ctr in net6-windows

Post by Edu » Mon Aug 19, 2024 8:00 am

Hello Konstantin,

Apologies for not having correctly understood the problem with our first answer.

The issue you describe, with the error message you quote, is similar to a known issue for TeeChart builds between September 2023 and January 2024 that has since been resolved. We are surprised to see it for a recent build, 4.2024.7.29. It may be that switching between frameworks is causing the problem as the dependencies are different, but we need to be sure how your project is configured. We think that it is likely not possible to combine Framework 4 and 6+ targets for TeeChart in the same project due to the dependency differences (of which System.Text.Json is one).

If you are setting multiple target frameworks in csproj please send us an example of your setup. In other respects, if your project is an older NET6 (NET7 & NET8) project, we recommend a clean start, removing the old Nuget completely from the project and then re-applying TeeChart with the current Nuget.

Regards,
Edu
Edu
Steema Support

Post Reply