So I have a C# console application that uploads files to s3 storage.
It works fine when I debug it from inside Visual Studio, however, when I build the .exe and run it off my server, I get errors saying that it couldn’t find the Access Key inside the App.config file.
System.ArgumentException: Access Key could not be found. Add an appsetting to your App.config with the name AWSAccessKey with a value of your access key.
Amazon.Runtime.AmazonServiceException: Unable to reach credentials server
The second error is might be caused by the first.
I have my App.config file in the same directory as the .exe I’m running, but that doesn’t help.
What else do I have to do?
Here’s my App.config file:
The build action for this file is “Embedded Resource” I’ve also tried changing it to “Content” and that didn’t help.
Some things that may or may not be relevant:
ILMerge to merge the
AWSSDK.dll (among others) into the
exe, then I run that file off of an Amazon EC2 instance through the command line.
When you look in your “bin” directory, the .config file should be named yourprogram.exe.config. It won’t find the configuration values otherwise, and it should be a content file, not an embedded resource. The .config file must always be present and in the same directory as the EXE.