FastReport icon indicating copy to clipboard operation
FastReport copied to clipboard

.NET6 The type initializer for 'FastReport.Utils.Res' threw an exception. Messages,WrongFileFormat NOT LOCALIZED!

Open uopeydel opened this issue 3 years ago • 3 comments

I try to run report is download from example that is use Simple List.frx and nwind.xml

https://github.com/FastReports/FastReport/blob/master/Demos/OpenSource/PdfExport/Program.cs

I create new project with .net6 With package

 FastReport.OpenSource Version="2022.1.10"  
 FastReport.OpenSource.Export.PdfSimple Version="2022.1.10" 

It show error like below

System.TypeInitializationException: The type initializer for 'FastReport.Utils.Res' threw an exception.
 ---> FastReport.Utils.FileFormatException: Messages,WrongFileFormat NOT LOCALIZED!
   at FastReport.Utils.XmlReader.RaiseException()
   at FastReport.Utils.XmlReader.ReadHeader()
   at FastReport.Utils.XmlReader.Read(XmlItem item)
   at FastReport.Utils.XmlDocument.Load(Stream stream)
   at FastReport.Utils.Res.LoadBuiltinLocale()
   at FastReport.Utils.Res..cctor()

It support .net6 yet?

uopeydel avatar Feb 22 '22 10:02 uopeydel

I got the same error in .NET 5.0. I couldn't load the template. FastReport.OpenSource Version="2022.1.14"
FastReport.OpenSource.Export.PdfSimple Version="2022.1.14"
FastReport.OpenSource.Export.OpenSource.Web Version="2022.1.14" FastReport.Community.2022.1.0 for my designer.

Capture

Wugka avatar Feb 23 '22 04:02 Wugka

any update ? same. . Net 6

thititongumpun avatar Sep 03 '22 08:09 thititongumpun

same issue in .NET 6 FastReport.OpenSource Version="2022.3.0" FastReport.OpenSource.Export.PdfSimple Version="2022.3.0"

Thanakorn-VK avatar Sep 14 '22 10:09 Thanakorn-VK

please make the runtime config file and add the

{ "runtimeOptions": { "tfm": "net6.0", "frameworks": [ { "name": "Microsoft.NETCore.App", "version": "6.0.0" }, { "name": "Microsoft.AspNetCore.App", "version": "6.0.0" } ], "configProperties": { "System.GC.Server": true, "System.Reflection.Metadata.MetadataUpdater.IsSupported": false,

  "System.Runtime.Serialization.EnableUnsafeBinaryFormatterSerialization": false
}

} }

Chirag2808-1998 avatar Feb 09 '23 06:02 Chirag2808-1998

I got a same error, how to slove it. FastReport.OpenSource (2023.1.12) FastReport.OpenSource.Export.PdfSimple (2023.1.12) FastReport.OpenSource.Web (2023.1.12)

pongsathornp35room avatar Feb 11 '23 07:02 pongsathornp35room

I got a same error, how to slove it. FastReport.OpenSource (2023.1.12) FastReport.OpenSource.Export.PdfSimple (2023.1.12) FastReport.OpenSource.Web (2023.1.12)

Hello dear please can we meet online? if possible you can set meet at [email protected]

Chirag2808-1998 avatar Feb 13 '23 05:02 Chirag2808-1998

i got error The type initializer for 'FastReport.Report' threw an exception. FastReport.OpenSource (2023.3.1)

on Ubuntu 22.04

anyone could solved?

my environment

ubuntu@ip-172-31-41-183:~$ dotnet --info .NET SDK: Version: 7.0.111 Commit: 06c8b346e4

Runtime Environment: OS Name: ubuntu OS Version: 22.04 OS Platform: Linux RID: ubuntu.22.04-x64 Base Path: /usr/lib/dotnet/sdk/7.0.111/

Host: Version: 7.0.11 Architecture: x64 Commit: ecb34f85ec

.NET SDKs installed: 7.0.111 [/usr/lib/dotnet/sdk]

.NET runtimes installed: Microsoft.AspNetCore.App 7.0.11 [/usr/lib/dotnet/shared/Microsoft.AspNetCore.App] Microsoft.NETCore.App 7.0.11 [/usr/lib/dotnet/shared/Microsoft.NETCore.App]

chukiatt avatar Sep 26 '23 05:09 chukiatt

@chukiatt , I had that exception recently when I deploy app with fastreport in ubuntu container. my problem was solved after installation of "libgdiplus" package in ubuntu.

yermakovsergey avatar Oct 06 '23 08:10 yermakovsergey

I have the same problem. I am using a Web Application on Azure with Linux. Is there some solution?

antonioalexl avatar Dec 28 '23 01:12 antonioalexl

Add this line on configure services on Startup.cs solved for me!

FastReport.Utils.Config.WebMode = true;

HudsonRomeu avatar Jan 18 '24 13:01 HudsonRomeu