[英]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 ).我有一个供应商提供的 .NET Framework 库(CyberSource 支付处理器 - https://github.com/CyberSource/cybersource-sdk-dotnet )。
This API is being referenced by an ASP.NET Core 3.0 application. ASP.NET Core 3.0 应用程序正在引用此 API。
Everything compiles fine but when I attempt to call a method in the .NET Framework library, I get the following exception:一切都编译正常,但是当我尝试调用 .NET Framework 库中的方法时,出现以下异常:
{"Method not found: 'Void System.ServiceModel.EndpointAddress..ctor(System.Uri, System.ServiceModel.EndpointIdentity, System.ServiceModel.Channels.AddressHeaderCollection)'."} {“找不到方法:'Void System.ServiceModel.EndpointAddress..ctor(System.Uri,System.ServiceModel.EndpointIdentity,System.ServiceModel.Channels.AddressHeaderCollection)'。”}
Things I've determined:我确定的事情:
Is there any reasonable way to make this work?有什么合理的方法可以使这项工作?
You can analyze the DLL with The .NET Portability Analyzer .您可以使用.NET Portability Analyzer分析 DLL。 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.如果 DLL 使用的所有类和方法在 .NET Standard/.NET Core 中都可用,则 CLR 将能够调用这些方法。 But some apis are not yet ported and that can be what you are facing.但有些 api 尚未移植,这可能是您面临的问题。 If that's the case, you may be able to fork and rewrite the code to use APIs available in .NET Core 3.如果是这种情况,您可以分叉并重写代码以使用 .NET Core 3 中可用的 API。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.