Hi,
I have to convert DGN and DWG files to an image format in the Unity software.
I downloaded Aspose.CAD and put the dll in the Unity Assets folder > System.Text.Json missing errors. I search around for this dll tried several but no luck.
@rtb.
Hello.
Could you please provide the screenshot with the error? What is the version of Aspose.CAD, what is .NET version? Could you please test if simple console project works separately?
Assembly ‘Assets/CADTest/lib/Aspose.CAD.dll’ will not be loaded due to errors:
Unable to resolve reference ‘System.Text.Json’. Is the assembly missing or incompatible with the current platform?
Reference validation can be disabled in the Plugin Inspector.
ReflectionTypeLoadException: Exception of type ‘System.Reflection.ReflectionTypeLoadException’ was thrown.
Parent class vtable failed to initialize, due to: VTable setup of type Aspose.CAD.FileFormats.GLB.ExtraProperties failed assembly:D:\tmp\CAD Unity Project\Assets\CADTest\lib\Aspose.CAD.dll type:ExtraProperties member:(null)
Could not set up parent class, due to: VTable setup of type Aspose.CAD.FileFormats.GLB.ExtraProperties failed assembly:D:\tmp\CAD Unity Project\Assets\CADTest\lib\Aspose.CAD.dll type:ExtraProperties member:(null)
Could not set up parent class, due to: VTable setup of type Aspose.CAD.FileFormats.GLB.ExtraProperties failed assembly:D:\tmp\CAD Unity Project\Assets\CADTest\lib\Aspose.CAD.dll type:ExtraProperties member:(null)
Could not set up parent class, due to: VTable setup of type Aspose.CAD.FileFormats.GLB.ExtraProperties failed assembly:D:\tmp\CAD Unity Project\Assets\CADTest\lib\Aspose.CAD.dll type:ExtraProperties member:(null)
Could not set up parent class, due to: Could not set up parent class, due to: VTable setup of type Aspose.CAD.FileFormats.GLB.ExtraProperties failed assembly:D:\tmp\CAD Unity Project\Assets\CADTest\lib\Aspose.CAD.dll type:ExtraProperties member:(null) assembly:D:\tmp\CAD Unity Project\Assets\CADTest\lib\Aspose.CAD.dll type:#=z1pJWWav9gi58i1bI9cDsQWYM6HzepD5ogg== member:(null)
I have tried several .NET version, currently used: Unity 2022.38f1, API Compatability Level is set to “.NET Framework” in general, the other option is “.NET Standard 2.1” which I have also tried.
When adding the System.Text.Json dll manually I get a bunch of similar errors missing libraries.
When adding the Aspose.CAD dll to a project in Visual Studio Community and adding the code, the dll’s compile well without errors (code not tested!) This is the same project used to compile other dll’s used in a Unity project. The other dll’s work well in Unity untill I added the code from the link above.
@rtb,
OK, is the version of Aspose.CAD 23.10? Do you use the library from net462 folder? Can you create and zip here just empty Unity project so we can run it and observe the issue?
Yes, the downloaded zip extracts to “Aspose.CAD.23.10(dll_only)”
I am busy at the moment, but I will create an empty Unity project an upload here, is there an upload size restriction?
[Edit] And the net462 dll also results in the same problem, I will add this dll to the Unity project
We will test further. So far a dwg file was converted well, we got a problem with a dgn file though, CadException: The Dgn version isn’t valid. Only Dgn: V7 are currently supported.
I am afraid I cannot share this specific dgn file. I searched for other dgn files. I only found a few, I either get the only v7 supported message and for example this e4.zip (4.2 KB)
It throws an ArgumentOutOfRangeException
Do you have/know a resource for free v7 DGN files to test just as a proof of concept?
@rtb,
I can see the issue with exporting of the attached file to PNG, we have created CADNET-9555 to investigate it. I don’t know about such resources, just searching for them, unfortinately.
@rtb,
the exception for this file is fixed for the latest Aspose.CAD for .NET 24.5. But the result is empty as there is no information available how these solids are stored inside the DGN format. The file contains only solids, so we can not support them and the result is empty.