I was following the AWS tutorials for .NET developers and found out that it features the usage of both SharedCredentialsFile
and NetSDKCredentialsFile
. Is there any difference between those two APIs? In my code, they can be interchanged without any apparent difference:
public CredentialProfile GetProfile(string profileName)
{
// Which one should I use?
var sharedFile = new SharedCredentialsFile();
//var sharedFile = new NetSDKCredentialsFile();
if (!sharedFile.TryGetProfile(profileName, out var result))
{
var options = new CredentialProfileOptions
{
AccessKey = Configuration.AccessKey,
SecretKey = Configuration.SecretKey
};
var profile = new CredentialProfile(profileName, options);
profile.Region = RegionEndpoint.EUWest1;
sharedFile .RegisterProfile(profile);
result = profile;
}
return result;
}
Is one of them obsolete? Is there a best practice to which one should be used? Or are they identical?
Note, that I am developing on a Windows PC, but the app will run on a Linux server. Could this make any difference?