

The Amazon SDK for .NET V3 has entered maintenance mode.

We recommend that you migrate to [Amazon SDK for .NET V4](https://docs.amazonaws.cn/sdk-for-net/v4/developer-guide/welcome.html). For additional details and information on how to migrate, please refer to our [maintenance mode announcement](https://aws.amazon.com/blogs/developer/aws-sdk-for-net-v3-maintenance-mode-announcement/).

# Migrating to version 3.5 of the Amazon SDK for .NET
Migrating to version 3.5Version 3.5 of the Amazon SDK for .NET

Version 3.5 of the Amazon SDK for .NET has been released.

Version 3.5 of the Amazon SDK for .NET further standardizes the .NET experience by transitioning support for all non-Framework variations of the SDK to [.NET Standard 2.0](https://docs.microsoft.com/en-us/dotnet/standard/net-standard). Depending on your environment and code base, to take advantage of version 3.5 features, you might need to perform certain migration work.

This topic describes the changes in version 3.5 and possible work that you might need to do to migrate your environment or code from version 3.

## What's changed for version 3.5


The following describes what has or hasn't changed in the Amazon SDK for .NET version 3.5.

### .NET Framework and .NET Core


Support for .NET Framework and .NET Core has not changed.

### Xamarin


Xamarin projects (new and existing) must target .NET Standard 2.0. See [.NET Standard 2.0 Support in Xamarin.Forms](https://docs.microsoft.com/en-us/xamarin/xamarin-forms/internals/net-standard) and [.NET implementation support](https://docs.microsoft.com/en-us/dotnet/standard/net-standard#net-implementation-support).

### Unity


Unity apps must target .NET Standard 2.0 or .NET 4.x profiles using Unity 2018.1 or later. For more information, see [.NET profile support](https://docs.unity3d.com/2020.1/Documentation/Manual/dotnetProfileSupport.html). In addition, if you're using **IL2CPP** to build, you must disable code stripping by adding a *link.xml* file, as described in [Referencing the Amazon SDK for .NET Standard 2.0 from Unity, Xamarin, or UWP](https://amazonaws-china.com/blogs/developer/referencing-the-aws-sdk-for-net-standard-2-0-from-unity-xamarin-or-uwp). After you port your code to one of the recommended code bases, your Unity app can access all of the services offered by the SDK.

Because Unity supports .NET Standard 2.0, the **AWSSDK.Core** package of the SDK version 3.5 no longer has Unity-specific code, including some higher-level functionality. To provide a better transition, all of the ***legacy*** Unity code is available for reference in the [aws/aws-sdk-unity-net](https://github.com/aws/aws-sdk-unity-net) GitHub repository. If you find missing functionality that impacts your use of Amazon with Unity, you can file a feature request at [https://github.com/aws/dotnet/issues](https://github.com/aws/dotnet/issues).

Also see [Special considerations for Unity support](unity-special.md).

### Universal Windows Platform (UWP)


Target your UWP application to [version 16299 or later](https://docs.microsoft.com/en-us/windows/uwp/updates-and-versions/choose-a-uwp-version) (Fall Creators update, version 1709, released October 2017).

### Windows Phone and Silverlight


Version 3.5 of the Amazon SDK for .NET does not support these platforms because Microsoft is no longer actively developing them. For more information, see the following:
+ [Windows 10 Mobile end of support](https://support.microsoft.com/en-us/help/4485197/windows-10-mobile-end-of-support-faq)
+ [Silverlight end of support](https://support.microsoft.com/en-us/help/4511036/silverlight-end-of-support)

### Legacy portable class libraries (profile-based PCLs)


Consider retargeting your library to .NET Standard. For more information, see [Comparison to Portable Class Libraries](https://docs.microsoft.com/en-us/dotnet/standard/net-standard#comparison-to-portable-class-libraries) from Microsoft.

### Amazon Cognito Sync Manager and Amazon Mobile Analytics Manager


High-level abstractions that ease the use of Amazon Cognito Sync and Amazon Mobile Analytics are removed from version 3.5 of the Amazon SDK for .NET. Amazon AppSync is the preferred replacement for Amazon Cognito Sync. Amazon Pinpoint is the preferred replacement for Amazon Mobile Analytics.

If your code is affected by the lack of higher-level library code for Amazon AppSync and Amazon Pinpoint, you can record your interest in one or both of the following GitHub issues: [https://github.com/aws/dotnet/issues/20](https://github.com/aws/dotnet/issues/20) and [https://github.com/aws/dotnet/issues/19](https://github.com/aws/dotnet/issues/19). You can also obtain the libraries for Amazon Cognito Sync Manager and Amazon Mobile Analytics Manager from the following GitHub repositories: [aws/amazon-cognito-sync-manager-net](https://github.com/aws/amazon-cognito-sync-manager-net) and [aws/aws-mobile-analytics-manager-net](https://github.com/aws/aws-mobile-analytics-manager-net).

## Migrating synchronous code


Version 3.5 of the Amazon SDK for .NET supports both .NET Framework and .NET Standard (through .NET Core versions like .NET core 3.1, .NET 5, and so on). Variations of the SDK that comply with .NET Standard provide only asynchronous methods, so if you want to take advantage of .NET Standard, you must change synchronous code so that it runs asynchronously.

The following code snippets show how you might change synchronous code into asynchronous code. The code in these snippets is used to display the number of Amazon S3 buckets.

The original code calls [ListBuckets](https://docs.amazonaws.cn/sdkfornet/v3/apidocs/items/S3/MS3ListBuckets.html).

```
private static ListBucketsResponse MyListBuckets()
{
  var s3Client = new AmazonS3Client();
  var response = s3Client.ListBuckets();
  return response;
}

// From the calling function
ListBucketsResponse response = MyListBuckets();
Console.WriteLine($"Number of buckets: {response.Buckets.Count}");
```

To use version 3.5 of the SDK, call [ListBucketsAsync](https://docs.amazonaws.cn/sdkfornet/v3/apidocs/items/S3/MS3ListBucketsAsyncCancellationToken.html) instead.

```
private static async Task<ListBucketsResponse> MyListBuckets()
{
  var s3Client = new AmazonS3Client();
  var response = await s3Client.ListBucketsAsync();
  return response;
}


// From an **asynchronous** calling function
ListBucketsResponse response = await MyListBuckets();
Console.WriteLine($"Number of buckets: {response.Buckets.Count}");

// OR From a **synchronous** calling function
Task<ListBucketsResponse> response = MyListBuckets();
Console.WriteLine($"Number of buckets: {response.Result.Buckets.Count}");
```