We are trying to understand a C# example of connecting to AWS through its SDK, and the project .csproj
file is like the following:
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net7.0</TargetFramework>
<RootNamespace>aws_connect_poc_7._0</RootNamespace>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="AWSSDK.SimpleSystemsManagement" Version="3.7.402.5" />
</ItemGroup>
</Project>
And, the Program.cs
file is like the following:
using Amazon.SSM;
using System;
class Program
{
static void Main(string[] args)
{
var ssmClient = new AmazonSSMClient();
Console.WriteLine("SSM Client created successfully.");
}
}
We are getting the following compiling errors:
We highly appreciate any hints and suggestions.
The namespace and class name you're using don't appear to be correct. Looking at some documentation it looks like you might have meant Amazon.SimpleSystemsManagement
and AmazonSimpleSystemsManagementClient
, respectively.
The following should clear up those errors:
using Amazon.SimpleSystemsManagement;
using System;
class Program
{
static void Main(string[] args)
{
var ssmClient = new AmazonSimpleSystemsManagementClient();
Console.WriteLine("SSM Client created successfully.");
}
}