使用访问密钥,秘密密钥和RegionEndPoint构造函数在C#中实例化AmazonS3Client突然失败,并出现DirectoryNotFoundException [英] Instantiating AmazonS3Client in C# using the access key, secret key and RegionEndPoint constructor is suddenly failing with DirectoryNotFoundException

查看:364
本文介绍了使用访问密钥,秘密密钥和RegionEndPoint构造函数在C#中实例化AmazonS3Client突然失败,并出现DirectoryNotFoundException的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的应用使用

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'.'

似乎它正在尝试查找aws配置文件或凭据文件,但为什么要这样做.该构造函数是否仍在工作,如果它明确获得访问密钥和秘密密钥,那又有什么需要?

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.

推荐答案

我的SVN项目设置有问题.删除它并签出新副本,摆脱了异常.

Something was wrong with my SVN project settings. Deleted it and checked out a fresh copy, got rid of the exception.

这篇关于使用访问密钥,秘密密钥和RegionEndPoint构造函数在C#中实例化AmazonS3Client突然失败,并出现DirectoryNotFoundException的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆