Comments (8)
We have released a fix for this bug today.
Please use the new package versions and try again:
AWSSDK.Core: 3.7.304.19
AWSSDK.DynamoDBv2: 3.7.303.25
from aws-sdk-net.
Hello @alvaromon,
Thank you for reporting the issue. Using below code sample I am able to reproduce the InvalidOperationException
that you mentioned.
using Amazon.DynamoDBv2;
using Amazon.DynamoDBv2.DataModel;
namespace DDB_LoadAsync_3343
{
public class Program
{
public static async Task Main()
{
Amazon.AWSConfigs.LoggingConfig.LogResponses = Amazon.ResponseLoggingOption.Always
Amazon.AWSConfigs.LoggingConfig.LogTo = Amazon.LoggingOptions.Console;
Amazon.AWSConfigs.AddTraceListener("Amazon", new System.Diagnostics.ConsoleTraceListener());
var client = new AmazonDynamoDBClient();
DynamoDBContext context = new DynamoDBContext(client);
var d = new MyClass { Number = "3.7.302", Addresses = new List<string>() { "add1", "add2" } };
await context.SaveAsync<MyClass>(d);
var loaded = await context.LoadAsync<MyClass>(d.Number, d.Addresses);
}
private class BaseClass
{
public string Number { get; set; }
public IList<string> Addresses { get; set; }
}
[DynamoDBTable("OverrideBase")]
private class MyClass : BaseClass
{
[DynamoDBHashKey]
public new string Number
{
get => base.Number;
set => base.Number = value;
}
public new List<string>? Addresses { get; set; }
}
}
}
I am able to reliably reproduce this error with AWSSDK.DynamoDBv2 3.7.300
onwards. I will review this issue with the .NET SDK team to investigate it further. We shall keep you posted.
Hi @YuriiMocherniuk,
The error you mentioned looks similar. Can you provide code sample for your use-case? Also, I don't see the package version for AWSSDK.DynamoDBv2
in the screenshot that you shared.
Regards,
Chaitanya
from aws-sdk-net.
We are currently working on a fix for this issue.
from aws-sdk-net.
thank you to the team. That was very fast!
from aws-sdk-net.
I'm having a similar issue, also on .NET 8:
System.InvalidOperationException: Dictionary already contains item with key Usage
at Amazon.Util.Internal.InternalSDKUtils.AddToDictionary[TKey,TValue](Dictionary`2 dictionary, TKey key, TValue value)
at Amazon.DynamoDBv2.DataModel.StorageConfig.GetMembersDictionary(Type type)
at Amazon.DynamoDBv2.DataModel.StorageConfig..ctor(Type targetType)
at Amazon.DynamoDBv2.DataModel.ItemStorageConfig..ctor(Type targetType)
at Amazon.DynamoDBv2.DataModel.ItemStorageConfigCache.CreateStorageConfig(Type baseType, String actualTableName, DynamoDBFlatConfig flatConfig)
at Amazon.DynamoDBv2.DataModel.ItemStorageConfigCache.GetConfig(Type type, DynamoDBFlatConfig flatConfig, Boolean conversionOnly)
at Amazon.DynamoDBv2.DataModel.BatchWrite`1..ctor(DynamoDBContext context, Type valuesType, DynamoDBFlatConfig config)
at Amazon.DynamoDBv2.DataModel.DynamoDBContext.CreateBatchWrite[T](DynamoDBOperationConfig operationConfig)
Do you think its origin is the same? Previously before .NET 8 and AWS NuGet packages upgrade we haven't been facing such problem.
from aws-sdk-net.
Extra information: the issue started to occur after the following NuGet package upgrade:
from aws-sdk-net.
Hi @bhoradc,
Actually, we had several NuGet packages referenced in other projects and the AWSSDK.Core, AWSSDK.DynamoDBv2 packages probably got referenced here as transitive dependencies (they haven't been referenced in this case explicitly).
As for the code that throws exception, overall it looks as follows:
var batch = context.CreateBatchWrite<UsageItem>();
context member here has DynamoDBContext type.
In this case there's Usage property present on both UsageItem class and its parent class. The type differs as in your example with Addresses property and we also use new keyword in the child class.
I hope this information helps with issue resolution.
Regards,
Yura
from aws-sdk-net.
Comments on closed issues are hard for our team to see.
If you need more assistance, please either tag a team member or open a new issue that references this one.
If you wish to keep having a conversation with other community members under this issue feel free to do so.
from aws-sdk-net.
Related Issues (20)
- TransferUtility does not support downloading objects in Requester Pays buckets. HOT 10
- DisableFetchingTableMetadata leads to key exception if PropertyConverter is used HOT 3
- `region` set in profile in `$HOME/.aws/config` is ignored HOT 12
- TransferUtilityUploadRequest.UploadProgressEvent event not firing HOT 10
- V4 Development: TargetFrameworks HOT 2
- V4 Development: Sensible LangVersion
- Record Support in DynamoDBContext HOT 3
- Null QueueUrl when using LocalStack HOT 3
- DisableFetchingTableMetadata leads to InvalidOperationException if PropertyConverter is used HOT 6
- AWSSDK.S3 ListObjectsV2 API returns Size incorrectly every other request for some subset of files +/- 2 bytes HOT 6
- V4 Development: DefineConstants requires an overhaul HOT 1
- AmazonS3Client.PutObjectAsync does not retry with HttpClient HttpCompletionOption.ResponseHeadersRead when using devproxy HOT 5
- Amazon.CloudWatch.Model.MetricDatum timestamp is not set correctly HOT 3
- connectCases:Add retry if created customer or case is not immediately available HOT 6
- Unable to use S3 Path Style Access S3 URL HOT 3
- Unable to connect to Timestream from using endpoint (.Net) HOT 3
- DynamoDB SDK convert Nullable DateTime to Local HOT 2
- When cancelled, dynamodb.eu-west-1.amazonaws.com throws an exception instead of returning HTTP code
- There is no way to get bedrock streaming api responses using async io. HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from aws-sdk-net.