Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

C# program missing reference to SSM of AWS SDK

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:

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

  • CS0234: The type or namespace name ‘SSM’ does not exist in the namespace ‘Amazon’ (are you missing an assembly reference?)
  • CS0246 The type or namespace name ‘AmazonSSMClient’ could not be found (are you missing a using directive or an assembly reference?)

We highly appreciate any hints and suggestions.

>Solution :

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.");
    }
}
Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading