Aspose.CAD.CadExceptions.ImageSaveException: Image export failed. The type initializer for '#=zjxpYVJbkJYYPXmlTUArhCwNr1jeJ' threw an exception

Hi, team.
I simply converting dwg to svg.
There’s an error in the code below.
and why can access under Windows/Temp?

Aspose.CAD version: 23.8,
dotnet sdk: .net7

public static byte[] ConvertToSimpleSVG(Stream dwgFileStream)
{
    using MemoryStream svgFileStream = new MemoryStream();
    using CadImage image = (CadImage) Image.Load(dwgFileStream);
    CadRasterizationOptions rasterizationOptions = new CadRasterizationOptions()
    {
        PageWidth = image.Width,
        PageHeight = image.Height,
        ExportAllLayoutContent = true,
        AutomaticLayoutsScaling = false,
    };

    image.Save(svgFileStream, new SvgOptions()
    {
        VectorRasterizationOptions = rasterizationOptions
    });

    return svgFileStream.ToArray();
}

System.AggregateException: One or more errors occurred. (Image export failed. The type initializer for ‘#=zjxpYVJbkJYYPXmlTUArhCwNr1jeJ’ threw an exception.)
—> Aspose.CAD.CadExceptions.ImageSaveException: Image export failed. The type initializer for ‘#=zjxpYVJbkJYYPXmlTUArhCwNr1jeJ’ threw an exception.
—> System.TypeInitializationException: The type initializer for ‘#=zjxpYVJbkJYYPXmlTUArhCwNr1jeJ’ threw an exception.
—> System.IO.IOException: Access to the path ‘\?\C:\WINDOWS\TEMP\TempFonts\0f7f1e79-9b61-4a9b-a0aa-4ac9e6a4f5dd’ is denied.

@Heewoong_Lee,
Hello.
Please, attach the initial DWG file so we can reproduce and debug the issue.

It’s a client’s file, so I sent it to you by e-mail when I posted it as an issue before
Here is the link

1 Like

@Heewoong_Lee,
could you please test whether this test application works on your side?
TestApp.zip (136.9 KB)

There was definitely an “image export failed” yesterday, but today it’s all working fine with testApp, my services, and debugging environments. However, the same pause as the linked problem is occurring in some files.
Customers are pointing out the problem of a rapid increase in memory and cpu when this phenomenon occurs. The files should be delivered directly by the customer company as they were last time. Should I send it to the same email address?

@Heewoong_Lee,
yes, please do this, we will investigate the issues.

Thanks. I’ve asked my client to provide the file to Aspose.

There was an opinion from the customer’s side that the cpu share soared to 90%, and later, it continued to occupy the 20% range, but the problem was not confirmed by me.

However, the problem of excessive memory increase for the problematic drawing has been identified, so I would appreciate it if you could check it together.

The image below identifies a memory surge before and after calling the “Image.Load” function and over time. (test file size 300kb)

https://teamdaydreamlab.notion.site/Image-Load-memory-issue-295c989e803e4b6abc31c62d589a6593?pvs=4

This link expires in a week

@Heewoong_Lee,
OK, we will check when we receive the file.

@Heewoong_Lee,
Hello.
Wanted to note that we have found the same export error for one other issue and the reason was access rights to that folder that is used to work with fonts. You also mentioned about some memory/cpu usage problem but I didn’t see that drawing file from you, is that issue relevant?

Hi, I’m always grateful for your hard work.

I also couldn’t see the cpu problem even in the local environment.
However, the customer’s window server consistently confirmed that the memory usage in the range of 20-90%.

we have identified a problem with memory usage while “Image.load” has not been completed since the start of the “Image.load” as attached to the link above.
Can’t check the memory problem?

@Heewoong_Lee,
Hello.
Thank you for kind words.
I have received pair of files yesterday and we checked them. We don’t see any CPU or memory issues now with them, we have tested for macOS too. Now we guess the issue may arise because previous versions of library are used (likely) or because of environment difference. We test all using the latest version Aspose.CAD 23.9. Could you please take a look whether the problem persists for it? Difference in test code sample may affect too. Could you please create some empty project with the conversion code so we can just add test files there, run it and observe the issue?