I am trying to save a graph to a OpenLink Virtuoso database using .net and dotNetRdf. Connection is successfully created, but when I try to save graph, I get this message:
An unhandled exception of type 'System.BadImageFormatException' occurred in dotNetRDF.Data.Virtuoso.dll Could not load file or assembly 'System.EnterpriseServices, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'. An attempt was made to load a program with an incorrect format.
My code is:
VirtuosoManager manager = new VirtuosoManager("localhost", 1111, "DB", "dba", "dba");
manager.SaveGraph(store.Graphs.First()); // exception happens here
DotNetRDF and DotNetRDF.Data.Virtuoso are v2.6.0. Target framework is .NET Core 3.1.
I have tried everything that's suggested (copying .dll to GAC, enabling 32-bit applications in default pool, changing Visual Studio build settings...) but nothing worked.
Is there any other solution for this problem?