private void btnRemoveProfile_Click(object sender, EventArgs e) { //Amazon.Util.ProfileManager.UnregisterProfile(cboAWSProfilesToCleanUp.Text); //var AWSProfile = new Amazon.Runtime.CredentialManagement.SharedCredentialsFile(); var netSDKFile = new NetSDKCredentialsFile(); netSDKFile.UnregisterProfile(cboAWSProfilesToCleanUp.Text); GetProfilesToCleanUp(); GetSavedProfiles(); cboAWSProfilesToCleanUp.Text = ""; btnRemoveProfile.Enabled = false; }
public static void MigrateProfile() { // Credential profile used to be stored in .net sdk credentials store. // Shared credentials file is more modern. Migrate old profile if needed. // Shows good form for profile management CredentialProfile profile; var scf = new SharedCredentialsFile(); if (!scf.TryGetProfile(profileName, out _)) { var nscf = new NetSDKCredentialsFile(); if (nscf.TryGetProfile(profileName, out profile)) { scf.RegisterProfile(profile); nscf.UnregisterProfile(profileName); } } }