FastReport instantiation throws TypeInitializationException

Initially, I started with the opensource library, then having issues when moving to dotnet 8 on a docker instance due to System.Drawing being dropped in support. Searching for answers stumbled up on the the FastReport.Core.Skia.Demo library. It was nearly a direct drop replacement. I reached out to buying a license, and looking at the licenses it looked like the Avalonia license fits the bill. All I needed was the core library, I did not need anything else. Turns out, the FastReport.Core.Skia library is not a part of the Avalonia license. Anyway, this is fine so long as everything works.

I continue with the FastReport.Avalonia library and when I try to instantiate:

var report = new FastReport.Report();

I receive the following error:

System.TypeInitializationException : The type initializer for 'FastReport.Report' threw an exception.

----> System.NullReferenceException : Object reference not set to an instance of an object.

If I am not using Avalonia is this library even useful?

Thank you

Comments

  • Looks like I need to use Avalonia.Desktop. Not what I was looking to do, but after preparing Avalonia's environment I could call it.

    var avalonia = AppBuilder.Configure<Application>()

    .UsePlatformDetect();

    avalonia.SetupWithoutStarting();

    var report = new FastReport.Report();

Leave a Comment

Rich Text Editor. To edit a paragraph's style, hit tab to get to the paragraph menu. From there you will be able to pick one style. Nothing defaults to paragraph. An inline formatting menu will show up when you select text. Hit tab to get into that menu. Some elements, such as rich link embeds, images, loading indicators, and error messages may get inserted into the editor. You may navigate to these using the arrow keys inside of the editor and delete them with the delete or backspace key.