amazon-gamelift-plugin-unity icon indicating copy to clipboard operation
amazon-gamelift-plugin-unity copied to clipboard

BUG: missing netstandard2.0 target for plugins (all *.dll files)

Open ArnCarveris opened this issue 1 year ago • 2 comments

Building SampleGame client standalone windows build with IL2CPP causes exception:

NotSupportedException: System.Configuration.ConfigurationManager::get_AppSettings
  at System.Configuration.ConfigurationManager.get_AppSettings () [0x00000] in <00000000000000000000000000000000>:0 
  at Amazon.AWSConfigs..cctor () [0x00000] in <00000000000000000000000000000000>:0 
  at Amazon.Runtime.ClientConfig..ctor (Amazon.Runtime.Internal.IDefaultConfigurationProvider defaultConfigurationProvider) [0x00000] in <00000000000000000000000000000000>:0 
  at Amazon.GameLift.AmazonGameLiftConfig..ctor () [0x00000] in <00000000000000000000000000000000>:0 
  at Amazon.GameLift.AmazonGameLiftClient..ctor (System.String awsAccessKeyId, System.String awsSecretAccessKey, Amazon.RegionEndpoint region) [0x00000] in <00000000000000000000000000000000>:0 
  at GameLiftClient..ctor (GameLiftApiCredentials apiCredentials, Delay delay, Logger logger) [0x00000] in <00000000000000000000000000000000>:0 
  at GameLift.Awake () [0x00000] in <00000000000000000000000000000000>:0 
Rethrow as TypeInitializationException: The type initializer for 'Amazon.AWSConfigs' threw an exception.
  at Amazon.Runtime.ClientConfig..ctor (Amazon.Runtime.Internal.IDefaultConfigurationProvider defaultConfigurationProvider) [0x00000] in <00000000000000000000000000000000>:0 
  at Amazon.GameLift.AmazonGameLiftConfig..ctor () [0x00000] in <00000000000000000000000000000000>:0 
  at Amazon.GameLift.AmazonGameLiftClient..ctor (System.String awsAccessKeyId, System.String awsSecretAccessKey, Amazon.RegionEndpoint region) [0x00000] in <00000000000000000000000000000000>:0 
  at GameLiftClient..ctor (GameLiftApiCredentials apiCredentials, Delay delay, Logger logger) [0x00000] in <00000000000000000000000000000000>:0 
  at GameLift.Awake () [0x00000] in <00000000000000000000000000000000>:0 

ArnCarveris avatar Apr 26 '24 11:04 ArnCarveris

It seems like Net Standard 2.0 is included in the Unity API Compatability Layer. Does following the instructions here https://docs.unity3d.com/Manual/dotnetProfileSupport.html resolve this bug?

levigerber avatar Apr 29 '24 21:04 levigerber

Nope, that was in AWSSDK.Core AWSConfig::GetConfig method, bc in net45 version gets config from System.Configuration.ConfigurationManager::get_AppSettings but it throws exception, but for netstandard2.0 it just returns hardcoded null, also it could be nice with targets had consistent API, bc non async method for netstandard2.0 became internal and that broke whole plugin bc many of code was relaying on that.

ArnCarveris avatar Apr 30 '24 06:04 ArnCarveris

I came across a similar issue discussed here: https://github.com/aws/amazon-gamelift-plugin-unity/issues/67. It appears that IL2CPP does not support System.Configuration.ConfigurationManager, and the successful resolution involved using the AWS .NET SDK's netstandard2.0 DLLs from NuGet packages instead. Does the instructions provided in this guide https://docs.aws.amazon.com/sdk-for-net/v3/developer-guide/unity-special.html help in resolving the bug?

nullPointer373 avatar Jun 24 '24 21:06 nullPointer373

Inferring the thumbs up to be resolved - closing. If this is not the case please feel free to reopen :)!

levigerber avatar Jul 01 '24 23:07 levigerber