-
Notifications
You must be signed in to change notification settings - Fork 490
Getting a PlatformNotSupportedException from AmazonDynamoDBConfig type initializer #3
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
Comments
Is there any additional information I can provide? |
Thanks for letting us know about the issue. Can you share your project.json file? I want to see if there is anything different in there versus how we set up our demo. |
This is also being tracked in the aws forums https://forums.aws.amazon.com/thread.jspa?threadID=244314&tstart=0 |
It sounds like you've been able to repo the problem independently. I'll post my project.json file tomorrow to help out. |
I push out version 3.3.5.1 of AWSSDK.Core which added defensive code around getting platform information. Hopefully that will fix the issue. I also pushed out new patch version of all the service packages like AWSSDK.DynamoDBv2 that require the latest core. So if you bump your dependency on AWSSDK.DynamoDBv2 to 3.3.1.1 that will pick up the new core change. |
This did the trick. Thanks! |
Thanks @normj , it worked for me by replacing AWSSDK.DynamoDBv2 version to 3.3.1.1 . Thanks!! |
I'm very excited about this functionality. It's nice to not have C# be left out in the cold. :)
I'm attempting to get an existing ASP.NET Core Web API app working under the serverless model. I am able to get the application deployed and running, but when I attempt to use DynamoDB, I'm getting a static initializer exception, which is of course uncatchable. I've pasted the exception details below. I'm running with AWSSDK.Core version 3.3.5 and AWSSDK.DynamoDBv2 version 3.3.1 (same version used in the demo) and using BasicAWSCredentials.
Is there something specific to the way that I'm using the Dynamo SDK that is causing this error?
System.TypeInitializationException: The type initializer for 'Amazon.DynamoDBv2.AmazonDynamoDBConfig' threw an exception. ---> System.TypeInitializationException: The type initializer for 'Amazon.Util.Internal.PlatformServices.ServiceFactory' threw an exception. ---> System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.PlatformNotSupportedException: Operation is not supported on this platform.
at System.Runtime.InteropServices.RuntimeInformation.get_OSDescription()
at Amazon.Util.Internal.InternalSDKUtils.DetermineOS()
at Amazon.Util.Internal.PlatformServices.EnvironmentInfo..ctor()
at System.RuntimeTypeHandle.CreateInstance(RuntimeType type, Boolean publicOnly, Boolean noCheck, Boolean& canBeCached, RuntimeMethodHandleInternal& ctor, Boolean& bNeedSecurityCheck)
at System.RuntimeType.CreateInstanceSlow(Boolean publicOnly, Boolean skipCheckThis, Boolean fillCache, StackCrawlMark& stackMark)
at System.Activator.CreateInstance(Type type, Boolean nonPublic)
at System.Activator.CreateInstance(Type type)
at Amazon.Util.Internal.PlatformServices.ServiceFactory..ctor()
at Amazon.Util.Internal.PlatformServices.ServiceFactory..cctor()
--- End of inner exception stack trace ---
at Amazon.Util.Internal.InternalSDKUtils.BuildUserAgentString(String serviceSdkVersion)
at Amazon.DynamoDBv2.AmazonDynamoDBConfig..cctor()
The text was updated successfully, but these errors were encountered: