问题
My app has been creating AmazonS3Client instances for a long time using this aws c# sdk constructor.
From the docs this does not seem to be the preferred way of doing it, but again, this has been working for a long time and I do not see any remarks on this constructor being deprecated.
Instantiating the object the way I am doing, is suddenly throwing a
System.IO.DirectoryNotFoundException: Could not find a part of the path 'C:\Users\myUser\.aws\credentials'.'
Seems it is trying to find a aws profile or credentials file, but why is it doing so. Is this constructor is still working, what's the need for that if it explicitly gets the access and secret keys?
Update: After the exception is thrown, manually setting the instantiation as the next statement in the debugger (in other words, trying again) will work.
回答1:
Something was wrong with my SVN project settings. Deleted it and checked out a fresh copy, got rid of the exception.
来源:https://stackoverflow.com/questions/54666615/instantiating-amazons3client-in-c-sharp-using-the-access-key-secret-key-and-reg