0

As the titles indicates, I'm trying to use a third-party dll compiled for .net framework.

I'm using Avalonia UI with .net 5.

Unfortunately I'm getting a "System.BadImageFormatException : Could not load file or assembly".

Exception triggers whenever my class's method (which contains a call to a dll method) is called.

class MainClass
{
    void MainMethod()
    {
        MyService.ServiceMethod(); <== Exception triggers here
    }
}
class MyService
{
    public static void ServiceMethod()
    {
        ThirdPartyMethod();
    }
}

I thought it was possible to use a .net framework dll in core as long as the library didn't use windows specific API (Use .net core with legacy .net framework dlls)

I've analyzed the dll with dotnet portability analyzer (https://marketplace.visualstudio.com/items?itemName=ConnieYau.NETPortabilityAnalyzer) which returned a 100% score with .net core 3.1.

I've tried messing with build target architectures (x64, x86) to no avail.

Is the dll straight-up incompatible? Can I do anything without the sources? Am I missing something?

0 Answers0