Why did I get the error "ActiveX component can't create object: 'com.paypal.sdk.COMNetInterop.COMAdapter'" with the Classic ASP SDK?
If you’ve installed the classic ASP SDK and got an “ActiveX component can’t create object” error, this is because you don't have RegAsm and gacutil in your system PATH. Depending on your configuration, you may also see a generic error such as "paypal_base error '80131500'."
RegAsm is a program shipped with the .NET SDK that allows you to export .NET assemblies as COM objects. Gacutil is a program that ships with the .NET framework that enables you to put assemblies in the GAC (Global Assembly Cache).
When the classic ASP SDK installer runs, it tries to invoke a RegAsm command and a gacutil command. If these aren't in your PATH, the SDK DLL (paypal_base.dll) won't be registered properly on your system, and you'll see errors when ASP tries to create an instance of an SDK object.
Here's how to resolve this issue:
- Download the latest .NET SDK and install it. You can download this from Microsoft.
- Once the .NET Framework SDK is installed, locate RegAsm and gacutil on your machine by searching for them. RegAsm.exe should be in the folder where you installed the .NET Framework SDK; and gacuti.exe should be in your .NET Framework directory.
- Add the path to gacutil and RegAsm to your system PATH.
- Run the following commands on paypal_base.dll, which is in the SDK/bin folder:
gacutil /i paypal_base.dll regasm paypal_base.dll /tlb:paypal_base.tlb - Try your code again. You may need to restart IIS as well.