1

I have successfully sent text message using AWS - Amazon Simple Notification Service NuGet package in my sample Application. (In this Package, it will automatically install AWSSDK- Core runtime) But, when I was trying to merge code in my current Project where We have already used AWS SDK for other Amazon Services, I am not getting one of the Property required for sending text message.

For Sending text message, We need to Create Publish Request object and pass that Object to AmazonSimpleNotificationServiceClient.

Please find below code

AmazonSimpleNotificationServiceClient smsClient = new AmazonSimpleNotificationServiceClient("Access Key", "Secret Access Key", Region);

PublishRequest publishRequest = new PublishRequest();
publishRequest.Message = message;
publishRequest.MessageAttributes = smsAttributes; 
publishRequest.PhoneNumber = "Phone number to which need to send text message";

Then, we need to pass this object to SNS

PublishResponse result = smsClient.Publish(publishRequest);

But I am not getting "PhoneNumber" property in my current Project which refers latest updated AWS SDK (Installed NuGEt Package in my Project - AWS SDK for .NET with latest version).

If I have tried to install earlier NuGEt package with which I have successfully run the code, I am getting conflicts as I am getting class "AmazonSimpleNotificationServiceClient" in both dlls viz. Core and AWSSDK.

Please suggest.

Mahesh Waghmare
  • 726
  • 9
  • 27

1 Answers1

0

PhoneNumber is still in the latest version of the SDK. Somehow after your merged in your other code it is tricking your build system into including an older version. PhoneNumber was added in version 3.1.1 of the AWSSDK.SimpleNotificationService package.

Did you add a new dependency to your project which already had a dependency on the SDK?

Norm Johanson
  • 2,964
  • 14
  • 13
  • 2
    Thus, I have added new references of AWSSDK.SimpleNotificationService package and given alias names to newly added AWS dlls and used them where I want to use AWS SNS service. It has resolved my Problem for now. But, yaah in the future, we need to remove old version 2 and install latest 3 version for each and every service. – Mahesh Waghmare Mar 02 '17 at 03:48