Could not load assembly USAePayAPI PublicKey Token='null' A named assembly is required

jtandev1

Member
Joined
Dec 19, 2021
Messages
5
Programming Experience
5-10
HI There,

I'm trying use to you the dll and receive this message.
OLE iDispatch exception code 0 from ...
Could not load file or assembly 'USAePayAPI, Version=4.0.1.0....
PublicKey Token='null'
A strongly-named assembly is required (Exception from HRESULT: 0x80131044)

How do I fix this?
My code is just a start with
var usaepay = new USAePayAPI.USAePay();

Thanks,
Joy
 
Make sure your code is running in a full trust context. Otherwise, get a a copy of the assembly that you are trying to use that is signed.

Out of curiosity, why are you trying to use USA ePay this way? From my quick skim readings of their website, it looks like they want you to use their REST APIs rather than use an assembly that wraps their APIs.
 
Make sure your code is running in a full trust context. Otherwise, get a a copy of the assembly that you are trying to use that is signed.

Out of curiosity, why are you trying to use USA ePay this way? From my quick skim readings of their website, it looks like they want you to use their REST APIs rather than use an assembly that wraps their APIs.

They still have the api instructions on their website


Joy
 
HI,

Just doing a compile on this and can't overcome this problem.
1>------ Build started: Project: xAuthorize, Configuration: Debug Any CPU ------
1>CSC : warning CS8002: Referenced assembly 'USAePayAPI, Version=4.0.1.0, Culture=neutral, PublicKeyToken=null' does not have a strong name.
1> xAuthorize -> C:\usaepay3\xAuthorize\bin\Debug\xAuthorize.dll
========== Build: 1 succeeded, 0 failed, 0 up-to-date, 0 skipped ==========

Not doing much on my code yet, just trying to load the dll.

Any ideas. Thanks,
Joy
 
Worked just fine for me. Did you follow the instructions on that link gave in post #3?
 
I tried to run in full trust context, perhaps it was a setting somewhere that I may have missed.
just strange that the compile for me comes up with the warning
 
Did you download the ZIP file from that link and then extract the .DLL from the ZIP file?

Did you browse to the DLL, or did you try add it as a COM object? The instructions specifically say that you should have browsed to it.

Are you compiling against .NET Framework 4.6 or higher as indicated in the instructions. I was using .NET 4.8 and didn't encounter any problems.
 
By any chance are you trying to make an assembly that is strongly named? As I recall, all your dependencies have to be strongly named as well.

If you are trying to make your assembly COM visible, you would also need to be strongly named as I recall.
 
By any chance are you trying to make an assembly that is strongly named? As I recall, all your dependencies have to be strongly named as well.

If you are trying to make your assembly COM visible, you would also need to be strongly named as I recall.
Hi There,

Yes, I browsed to the dll and added it.
Even did code signing using SN.exe
I compiled it under .NET 4.7

Joy
 
No. Don't strong name sign your assembly. As I said, that will then put in a requirement that your dependencies be strong name signed, and that assembly you are using is not strong name signed.
 
Back
Top Bottom