# How do I use the AWS SDK for .NET with Stook?

You can connect your .NET applications to **Medianova Stook Object Storage** using the AWS SDK for .NET. This allows you to create buckets, upload objects, and manage your Stook storage directly from Visual Studio.

***

### Prerequisites

* **Visual Studio** installed
* [**AWS Toolkit for Visual Studio**](https://aws.amazon.com/visualstudio/) installed
* Medianova Stook credentials:
  * **Access Key**
  * **Secret Key**
  * **Endpoint**

⚠️ The AWS Toolkit includes sample code examples to help you get started quickly.

***

### Installation

1. Download and install **Visual Studio**.
2. Download and install the **AWS Toolkit for Visual Studio**.

***

### Example: Create a Bucket in Stook

```csharp
using System;
using Amazon.Runtime;
using Amazon.S3;
using Amazon.S3.Model;
using Amazon.S3.Util;

namespace s3Example
{
    internal class Program
    {
        private static string bucketName = "medianovatest";
        private static string accessKey = "Enter Access Key";
        private static string secretKey = "Enter Secret Key";

        static async Task Main(string[] args)
        {
            var s3Config = new AmazonS3Config
            {
                RegionEndpoint = Amazon.RegionEndpoint.EUWest1,
                ServiceURL = "https://xxxxxxxxx.mncdn.com",
                ForcePathStyle = true
            };

            AWSCredentials awsCredentials = new BasicAWSCredentials(accessKey, secretKey);

            using (var s3Client = new AmazonS3Client(awsCredentials, s3Config))
            {
                await CreateBucket(s3Client);
            }

            Console.WriteLine("Operation completed.");
        }

        private static async Task CreateBucket(AmazonS3Client s3Client)
        {
            var createBucketRequest = new PutBucketRequest
            {
                BucketName = bucketName,
                UseClientRegion = true
            };
            try
            {
                var response = await s3Client.PutBucketAsync(createBucketRequest);
                Console.WriteLine($"Bucket creation status: {response.HttpStatusCode}");
            }
            catch (AmazonS3Exception ex)
            {
                Console.WriteLine($"{ex.Message}");
            }
        }
    }
}
```

*Caption: Example .NET code for connecting to Stook and creating a bucket*

***

### Troubleshooting / FAQ

* **Bucket already exists error:** Use a unique bucket name.
* **Connection error:** Check Stook endpoint and credentials.
* **Access denied:** Verify Access Key and Secret Key.

***

### References

* [AWS Toolkit for Visual Studio](https://aws.amazon.com/visualstudio/)


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://clients.medianova.com/products/object-storage-stook/integration-and-usage-guides/how-do-i-use-the-aws-sdk-for-.net-with-stook.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
