Instantiating AmazonS3Client in C# using the access key, secret key and RegionEndPoint constructor is suddenly failing with DirectoryNotFoundException

。_饼干妹妹 提交于 2019-12-11 17:54:16

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!