When I use Aspose.CAD 23.10 to convert dwf file to pdf in parallel, it throws ImageLoadException exception.
The sample code
void Main()
{
var list = new List<String>();
list.Add(@"C:\Users\54390\Desktop\abc\1213\22\file1.dwf");
list.Add(@"C:\Users\54390\Desktop\abc\1213\22\file2.dwf");
//Success
SeriesProcess(list);
//Faild.Throw a Exception: Drawing loading failed: Unsupported format
ParallelProcess(list);
}
private static void SeriesProcess(List<String> list)
{
list.ForEach(fileName =>
{
using (var image = Load(fileName))
{
//
}
});
}
private static void ParallelProcess(List<String> list)
{
list.AsParallel().ForAll(fileName =>
{
using (var image = Load(fileName))
{
//
}
});
}
private static Aspose.CAD.Image Load(string path)
{
var loadOptions = new Aspose.CAD.LoadOptions();
loadOptions.IgnoreErrors = true;
return Aspose.CAD.Image.Load(path, loadOptions);
}
The demo file
demofile.zip (1.1 MB)
The exception info
20231125215335.jpg (238.7 KB)