简体   繁体   中英

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?

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM