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?

1 Answer 1

2

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.

Sign up to request clarification or add additional context in comments.

8 Comments

Portability Analyzer is giving a 75% portability report. It's not an option for us to rewrite their library at this point.
I have installed System.ServiceModel.Primitives package and EndpointAddress indeed does not have default ctor. Can you target net48 instead of netcoreapp3.1 if fork/modify is not an option? That can work.
Asp.Net 3 requires Core 3.0 - it's not compatible with net48.
Yes, I meant an api service proxy. WIll probably build it in .NET framework 4.x. :-/
@user1142433 Interested to hear how you got on with this, as I'm currently facing a similar problem. If you did get something working, it would also make a great self-answer to this question.
|

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.