How to use a library that requires .NET Framework 4.5 in a .NET Core project

267 Views Asked by At

I need to use a package called NXOpen which requires .NET Framework 4.5 or later, in my project which is running .NET Core.

I can include NXOpen and write code with it, however on runtime I get the following error, "Could not load type 'System.Runtime.Remoting.Messaging.IMessageSink' from the assembly 'mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'. I've found out that this error occurs because this class is not included in .NET Core. Is there any way to resolve this issue without downgrading my project to .NET Framework? I would really rather not write a project in an already outdated framework.

1

There are 1 best solutions below

0
On

I'm almost certain that this cannot be done. NX APIs are compiled with .NET Framework and not .NET Core. Although if you are creating a library then you can create it in .NET Standard. .NET Standard can be reference by both .NET Framework and .NET Core projects. Also, .NET Framework for NX APIs depends on NX Versions as well.