-
Notifications
You must be signed in to change notification settings - Fork 862
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Inconsistent configuration section names in SDK and its documentation #624
Comments
Hi, it looks like you are looking at the wrong documentation. Notice that there's a separate configuration documentation page for .Net Core which specifies Regarding the DynamoDB problem you encountered, are you creating the service client as suggested in the documentation? var options = Configuration.GetAWSOptions();
IAmazonS3 client = options.CreateServiceClient<IAmazonS3>(); |
What about the documentation for other fields such as Yes, I create the client following the approach you mentioned. I created a minimal example showing the problem where |
No they do not. We'll update the docs to make this clear. |
Is there any recommended way to set up the table name prefix from the configuration file in .NET core? |
There is no mechanism yet for the .NET Core version of the SDK to get the value from the file, but once you do get this value from a configuration into your application, you can apply it globally by setting |
Is there any better way to do this? I read that way would be deprecated. |
There is still no way to set the table name prefix through the .NET Core configuration system in 2020? |
While trying to use an
app.config
file to store my AWS profile and some DynamoDB-related information, I have found out some inconsistencies between the section names actually supported by the SDK and the ones described in the documentation.According to http://docs.aws.amazon.com/sdk-for-net/v3/developer-guide/net-dg-config-ref.html#net-dg-config-ref the way to specify the profile name is by using the
profileName
tag as in:However, in ConfigurationExtensions.cs a tag named
profile
is looked for (instead ofprofileName
).I am loading the
app.config
file as follows:The following statement:
Configuration.GetAWSOptions().Profile
returns
null
ifprofileName
is used, but it returns the correct profile name ifprofile
is used instead.A similar, but probably unrelated problem, occurs when trying to specify the table name prefix in the
app.config
file. According to the documentation (same link as above), the way to specify the prefix is as follows:But, in AWSConfigs.DynamoDB.cs the key to access this property is defined as:
public const string DynamoDBContextTableNamePrefixKey = "AWS.DynamoDBContext.TableNamePrefix";
It seems the
dynamoDB
tag is missing (compared to the documentation). Moreover, I believe that the table name prefix is intended to be read from the configuration in the following statement:this.TableNamePrefix = AWSConfigs.GetConfig(AWSConfigsDynamoDB.DynamoDBContextTableNamePrefixKey);
See code here.
But, if I am not mistaken, that method is implemented here and it just returns
null
:So, it seems the
tableNamePrefix
tag might not be supported for .NET core.I have managed to have it working by adding the following statements to my application:
Where
Configuration
is the result of using theConfigurationBuilder
(as shown earlier).But, I wonder whether there is a better way to do it.
Environment
.NET Core Info
dotnet --info
:The text was updated successfully, but these errors were encountered: