Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Referencing .NET Framework DLL from .Net Core 3

I have a .NET Framework library provided by a vendor (CyberSource payment processor - https://github.com/CyberSource/cybersource-sdk-dotnet).

This API is being referenced by an ASP.NET Core 3.0 application.

Everything compiles fine but when I attempt to call a method in the .NET Framework library, I get the following exception:

{"Method not found: 'Void System.ServiceModel.EndpointAddress..ctor(System.Uri, System.ServiceModel.EndpointIdentity, System.ServiceModel.Channels.AddressHeaderCollection)'."}

Things I've determined:

  • Vendor doesn't provide a .NET Core or .NET Standard -compliant library
  • Library source is not portable as-is to .NET Standard or .NET Core

Is there any reasonable way to make this work?

like image 204
user1142433 Avatar asked Jan 18 '26 11:01

user1142433


1 Answers

You can analyze the DLL with The .NET Portability Analyzer. If all classes and methods that the DLL uses are available in .NET Standard/.NET Core then CLR will be able to call those methods. But some apis are not yet ported and that can be what you are facing. If that's the case, you may be able to fork and rewrite the code to use APIs available in .NET Core 3.

like image 156
Andrii Litvinov Avatar answered Jan 20 '26 22:01

Andrii Litvinov



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!