sample-code-csharp icon indicating copy to clipboard operation
sample-code-csharp copied to clipboard

Sample code for creating Subscription code doesn't resolve ANetApiRequest

Open jcaulabaugh opened this issue 6 years ago • 1 comments

ApiOperationBase<ANetApiRequest, ANetApiResponse>.RunEnvironment = AuthorizeNet.Environment.SANDBOX;

This line from the sample code gives the error: ANetApiRequest is an ambiguous reference between 'AuthorizeNet.ApiCore.ANetApiRequest' and 'AuthorizeNet.Api.Contracts.V1.ANetApiRequest'

If I try to fully qualify the reference, it says 'ApiCore' namespace not found and 'Api' reference not found, respectively.

jcaulabaugh avatar Apr 09 '19 06:04 jcaulabaugh

Can you tell me which solution file you opened? Also, which version of the SDK are you using?

The namespace 'AuthorizeNet.ApiCore.ANetApiRequest' appears in the .Net Core SDK whereas the namespace 'AuthorizeNet.Api.Contracts.V1.ANetApiRequest' appears in the .Net v4.6.1 SDK.

You should ideally be using only one reference at a time.

gnongsie avatar Apr 09 '19 07:04 gnongsie