我已经在我的应用程序配置中这样声明了RegionEndpoint
<add key="AWSRegion" value="EUWest1" xdt:Transform="Insert"/>
Run Code Online (Sandbox Code Playgroud)
在我的程序中,我尝试将其称为AWSRegion
private static string RegionEndPoint = ConfigurationManager.AppSettings["AWSRegion"];
Run Code Online (Sandbox Code Playgroud)
所以当我声明我的SQSClient时出现错误,无法从字符串转换为RegionEndPoint
var SQSClient = new AmazonSQSClient(credentials, RegionEndPoint);
Run Code Online (Sandbox Code Playgroud)
我试图在这里理解这个问题,如何为C#.NET SDK设置EndPoint / Region:EC2Client?
但它适用于EC2Client,因此对我来说似乎不起作用。
我也曾尝试使用这样的AWS开发工具包声明regionendpoint
private static RegionEndpoint RegionEndPoint = ConfigurationManager.AppSettings["AWSRegion"];
Run Code Online (Sandbox Code Playgroud)
我还收到一条错误消息,提示无法从字符串类型隐式转换为Amazon.RegionEndpoint
因此,如果有办法在配置文件中添加RegionEndPoint并在SQSClient中使用它,请帮助我。