Error opening DXF file

Trying Aspose.CAD again to see if I can do something simple. I am using VB.Net. When trying to load any dxf file I get an error.

    Dim sourceFilePath As String = "C:\Temp\DXF\test.dxf"
    Dim cadImage As CadImage = CType(Aspose.CAD.Image.Load(sourceFilePath), CadImage)

I get an error:

System.TypeInitializationException: ‘The type initializer for ‘Aspose.CAD.Image’ threw an exception.’
ReflectionTypeLoadException: Unable to load one or more of the requested types. Retrieve the LoaderExceptions property for more information.

Any ideas? I have tried multiple dxf files.

@Raider007,
Hi.
Please provide such DXF file so we can reproduce the issue.

DXF.zip (104.3 KB)

I have tried both of these and they give the same error. I can open the files in AutoCAD with no errors.

@Raider007,
Could you please test if this sample project works for you?
TestApp.zip (330.5 KB)

Aspose Testing.zip (163.7 KB)

Why would mine not work?

@Raider007,
I guess last line should be

cadImage.Save(StrOutputFilename, pdfOptions)

but except of this your project works for me. Here is my result: test.pdf (31.7 KB). Do you use latest Aspose.CAD for .NET 23.6?

Thats so strange then… Yes I am using the latest version I downloaded from your website today. I still get that error yet if you run the same solution then you dont… That does not make sense at all…
I still get that same error on the load method. Strange thing is your console solution works.

What else can I try?

@Raider007,
could you please send us full stack traces and messages from LoaderExceptions at this error, I hope we can see more precisely what causes the issue. You cal also try to create a new project again, clean and rebuild existing demo project on your side, relink the Aspose.CAD library again.

Hi sorry for the delay in responding.
It seems that if I use Nuget to get your dll then it works. Maybe there are other references thats required and added by Nuget.

@Raider007,
Hi,
still seems to be weird issue for me, as I tested your project without NuGet yesterday (using installation of msi from our site) and it worked. Anyway, I’m happy to hear it works now.