Failing to save DWG as JPG

I’ve found a strange issue which only seems to happen when running our code in an Azure Function. I can’t get it to repro locally.

I’m simply loading a DWG (attached) with Aspose.CAD and saving it as a 512x512 JPEG. Running the latest Aspose.CAD .NET nuget package.

file.zip (47.8 KB)

Failed to process image [file.dwg].
Image export failed. Operations that change non-concurrent collections must have exclusive access. A concurrent update was performed on this collection and corrupted its state. The collection's state is no longer correct.

Aspose.CAD.CadExceptions.ImageSaveException:
   at Aspose.CAD.Image.jd3e6ze6d4bq8slwvmklfafdjn7dzqla (Aspose.CAD, Version=22.7.0.0, Culture=neutral, PublicKeyToken=716fcc553a201e56)
   at Aspose.CAD.Image.jd3e6ze6d4bq8slwvmklfafdjn7dzqla (Aspose.CAD, Version=22.7.0.0, Culture=neutral, PublicKeyToken=716fcc553a201e56)
Inner exception System.InvalidOperationException handled at Aspose.CAD.Image.jd3e6ze6d4bq8slwvmklfafdjn7dzqla:
   at System.ThrowHelper.ThrowInvalidOperationException_ConcurrentOperationsNotSupported (System.Private.CoreLib, Version=6.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e)
   at System.Collections.Generic.Dictionary`2.TryInsert (System.Private.CoreLib, Version=6.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e)
   at . (Aspose.CAD, Version=22.7.0.0, Culture=neutral, PublicKeyToken=716fcc553a201e56)
   at . (Aspose.CAD, Version=22.7.0.0, Culture=neutral, PublicKeyToken=716fcc553a201e56)
   at . (Aspose.CAD, Version=22.7.0.0, Culture=neutral, PublicKeyToken=716fcc553a201e56)
   at . (Aspose.CAD, Version=22.7.0.0, Culture=neutral, PublicKeyToken=716fcc553a201e56)
   at . (Aspose.CAD, Version=22.7.0.0, Culture=neutral, PublicKeyToken=716fcc553a201e56)
   at . (Aspose.CAD, Version=22.7.0.0, Culture=neutral, PublicKeyToken=716fcc553a201e56)
   at . (Aspose.CAD, Version=22.7.0.0, Culture=neutral, PublicKeyToken=716fcc553a201e56)
   at Aspose.CAD.Image+. (Aspose.CAD, Version=22.7.0.0, Culture=neutral, PublicKeyToken=716fcc553a201e56)
   at . (Aspose.CAD, Version=22.7.0.0, Culture=neutral, PublicKeyToken=716fcc553a201e56)
   at Aspose.CAD.Image.jd3e6ze6d4bq8slwvmklfafdjn7dzqla (Aspose.CAD, Version=22.7.0.0, Culture=neutral, PublicKeyToken=716fcc553a201e56)

I’ve also seen this exception at times when converting the same file to SVG:

Aspose.CAD.CadExceptions.ImageSaveException:
   at Aspose.CAD.Image.jd3e6ze6d4bq8slwvmklfafdjn7dzqla (Aspose.CAD, Version=22.7.0.0, Culture=neutral, PublicKeyToken=716fcc553a201e56)
   at Aspose.CAD.Image.jd3e6ze6d4bq8slwvmklfafdjn7dzqla (Aspose.CAD, Version=22.7.0.0, Culture=neutral, PublicKeyToken=716fcc553a201e56)
Inner exception System.ArgumentException handled at Aspose.CAD.Image.jd3e6ze6d4bq8slwvmklfafdjn7dzqla:
   at System.ThrowHelper.ThrowAddingDuplicateWithKeyArgumentException (System.Private.CoreLib, Version=6.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e)
   at System.Collections.Generic.Dictionary`2.TryInsert (System.Private.CoreLib, Version=6.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e)
   at . (Aspose.CAD, Version=22.7.0.0, Culture=neutral, PublicKeyToken=716fcc553a201e56)
   at . (Aspose.CAD, Version=22.7.0.0, Culture=neutral, PublicKeyToken=716fcc553a201e56)
   at . (Aspose.CAD, Version=22.7.0.0, Culture=neutral, PublicKeyToken=716fcc553a201e56)
   at . (Aspose.CAD, Version=22.7.0.0, Culture=neutral, PublicKeyToken=716fcc553a201e56)
   at . (Aspose.CAD, Version=22.7.0.0, Culture=neutral, PublicKeyToken=716fcc553a201e56)
   at . (Aspose.CAD, Version=22.7.0.0, Culture=neutral, PublicKeyToken=716fcc553a201e56)
   at . (Aspose.CAD, Version=22.7.0.0, Culture=neutral, PublicKeyToken=716fcc553a201e56)
   at Aspose.CAD.Image+. (Aspose.CAD, Version=22.7.0.0, Culture=neutral, PublicKeyToken=716fcc553a201e56)
   at . (Aspose.CAD, Version=22.7.0.0, Culture=neutral, PublicKeyToken=716fcc553a201e56)
   at Aspose.CAD.Image.jd3e6ze6d4bq8slwvmklfafdjn7dzqla (Aspose.CAD, Version=22.7.0.0, Culture=neutral, PublicKeyToken=716fcc553a201e56)

@kirkmarple,
Hello, we will try to reproduce this is scope of CADNET-8743.

The issues you have found earlier (filed as CADNET-8743) have been fixed in this Aspose.CAD for .NET 23.2 update. This message was posted using Bugs notification tool by oleksii.gorokhovatskyi