|« PreviousNext »|
|Did this page help you? Yes | No | Tell us about it...|
To get started with the AWS SDK for .NET, set up the following:
AWS Account and Credentials
.NET Development Environment
AWS SDK for .NET
To access AWS, you will need to sign up for an AWS account.
To sign up for an AWS account
Go to http://aws.amazon.com, and then click Sign Up.
Follow the on-screen instructions.
Part of the sign-up procedure involves receiving a phone call and entering a PIN using the phone keypad.
AWS sends you a confirmation email after the sign-up process is complete. At any time, you can view your current account activity and manage your account by going to http://aws.amazon.com and clicking My Account/Console.
To get your access key ID and secret access key
Access keys consist of an access key ID and secret access key, which are used to sign programmatic requests that you make to AWS. If you don't have access keys, you can create them by using the AWS Management Console. We recommend that you use IAM access keys instead of AWS root account access keys. IAM lets you securely control access to AWS services and resources in your AWS account.
To create access keys, you must have permissions to perform the required IAM actions. For more information, see Granting IAM User Permission to Manage Password Policy and Credentials in Using IAM.
Go to the IAM console.
From the navigation menu, click Users.
Select your IAM user name.
Click User Actions, and then click Manage Access Keys.
Click Create Access Key.
Your keys will look something like this:
Access key ID example: AKIAIOSFODNN7EXAMPLE
Secret access key example: wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY
Click Download Credentials, and store the keys in a secure location.
Your secret key will no longer be available through the AWS Management Console; you will have the only copy. Keep it confidential in order to protect your account, and never email it. Do not share it outside your organization, even if an inquiry appears to come from AWS or Amazon.com. No one who legitimately represents Amazon will ever ask you for your secret key.
To use the AWS SDK for .NET, you'll need the following software:
Microsoft .NET Framework 3.5 or later
Microsoft Visual Studio Professional edition or better, version 2010 or newer.
To confirm installation
Start Visual Studio.
On the Help menu, click About. A dialog box opens that lists Microsoft Visual Studio and .NET Framework versions.
Configuring the .NET CLR
For the best performance of your server-based applications with the AWS SDK for .NET, we recommend that you use Server mode garbage collection (GC).
To enable Server mode GC, add the following to your app.config file:
<runtime> <gcServer enabled="true"/> <gcConcurrent enabled="true"/> </runtime>
Server mode GC works only on systems with multiple processors or processor cores. Enabling Server mode GC has no effect otherwise.
To install the AWS SDK for .NET
Click the Download button in the upper right corner of the page. Your browser will prompt you to save the install file.
To begin the install process, open the saved install file and follow the on-screen instructions.
By default, the AWS SDK for .NET is installed in the Program Files directory, which requires administrator privileges. You can install the AWS SDK for .NET as a non-administrator if you choose a different installation directory.
The AWS SDK for .NET is also available on GitHub.
You can install optional extensions for the SDK for .NET, such as a session state provider and a trace listener that use DynamoDB. For more information about SDK for .NET extensions, see Install AWS Assemblies with NuGet.
The AWS SDK for .NET provides the following project template(s) you can use to build a new project on Amazon Web Services:
Creates a console application that references the AWS .NET library
AWSSDK.dll) with a sample
file that makes a basic request to Amazon Simple Storage Service (Amazon S3), Amazon SimpleDB, and Amazon Elastic Compute Cloud (Amazon EC2).
Creates a console application that references the AWS .NET library (
AWSSDK.dll), but does not include
any code in the
Creates an ASP.NET application that references the AWS .NET library (
AWSSDK.dll) with a sample
Program.cs file that makes a basic request to Amazon S3, Amazon SimpleDB, and Amazon EC2.
The general process to create a new project based on a project template is similar across Visual Studio editions, but we'll go through the steps for Visual Studio 2010 Professional Edition.
To create a new project in Visual Studio 2010 Professional Edition
Launch Visual Studio.
On the File menu, select New, and then click Project. The New Project dialog box opens.
Select AWS from the list of installed templates, and then select the AWS project template you want to use. Enter a project name, and then click OK.
On project creation, the template prompts you for the security credentials that your code should use to access AWS. To use the credentials for one of the accounts that was added with the AWS Toolkit for Visual Studio, click Use existing account and select the account from the drop-down list. To add a new set of credentials, click Use a new account and enter the credentials information. Once you have specified the credentials to use, click OK.
If you do not want to specify any credentials at this time, click Skip. Note, however, that your code will not be able to access AWS without a valid set of credentials.
Running the Project
You can run the project immediately after the project is created by pressing F5 (or clicking Start Debugging on the Debug menu).
Where Do I Go from Here?
From here, you can check out the tutorials included in this developer guide.
This tutorial explains how to set up requests for Amazon EC2 Spot Instances, how to determine when they have completed, and how to clean up afterward.
The Additional Resources section has pointers to other resources to assist you in programming AWS.