Failed to create AmazonGameLiftClient in Unity3d












4















I use below code to create GameClient in Unity3d:



AmazonGameLiftClient client = 
new AmazonGameLiftClient("accessKeyId",
"accessKey",
RegionEndpoint.CNNorth1);


Above code is the first line in Awake(), no any other leading codes.



I get below error:



NullReferenceException: Object reference not set to an instance of an object
Amazon.CSMSection.get_CSMEnabled ()
Amazon.Util.CSMConfig.Configure (Amazon.CSMSection section)
Amazon.Util.Internal.RootConfig..ctor ()
Amazon.AWSConfigs..cctor ()
Rethrow as TypeInitializationException: An exception was thrown by the type initializer for Amazon.AWSConfigs
Amazon.Runtime.ClientConfig..ctor ()
Amazon.GameLift.AmazonGameLiftConfig..ctor ()
Amazon.GameLift.AmazonGameLiftClient..ctor (System.String awsAccessKeyId, System.String awsSecretAccessKey, Amazon.RegionEndpoint region)


Is there anything I forgot to do?
I assume the root cause is I do not put app.config in the correct place.
So AWS SDK does not init correctly, but I have not found any tutorial for using Unity3d as Amazon GameLift client :(



My Environment:




  • OS: Mac OS X 10.14.1

  • Unity3d: 2018.2.12f1

  • AWS SDK Core: 3.3.29.10(.net35)

  • AWS SDK GameLift: 3.3.12.29(.net35)


Update:
The AWS SDK relies on System.ConfigurationManager which seems not available in Unity3d projects. It seems the root cause of the NullReferenceException.










share|improve this question

























  • First of all, the error gives all the details to debug it. Second, Google gives you the answers. This will help you understanding the issue -> stackoverflow.com/questions/4660142/…

    – Cabrra
    Nov 22 '18 at 14:09













  • This seems like a configuration issue; please provide the following details: Name the AWS SDK nuget packages you're using and which version they are on. Name the .NET framework you're on and which version it is. Any other relevant code leading up to this point or any other references you've made to the AWS SDK that executed up to this point would also be helpful for context. In the interim, make sure you're using the correct AWS SDK packages for your framework and that they are with the latest version. Also make sure you're using the correct AccessKey/SecretKey.

    – Anthony Neace
    Nov 22 '18 at 16:32













  • @AnthonyNeace you are right. It should be a configuration issue. I have no idea where to put the app.config in a Unity3d project. I am trying to figure it out.

    – Yongyi
    Nov 24 '18 at 3:26











  • I'm experiencing this issue as well after upgrading the aws sdk. @AnthonyNeace this is entry point to the api. You make a config before making a client to do other things so there is no other context. Cabrra's comment is also really shallow and unhelpful. This NRE happens within the default constructor of the config classes so there must be some kind of non-obvious external setup that needs to be done now. Perhaps some kind of factory method?

    – Jayd16
    Nov 28 '18 at 23:49
















4















I use below code to create GameClient in Unity3d:



AmazonGameLiftClient client = 
new AmazonGameLiftClient("accessKeyId",
"accessKey",
RegionEndpoint.CNNorth1);


Above code is the first line in Awake(), no any other leading codes.



I get below error:



NullReferenceException: Object reference not set to an instance of an object
Amazon.CSMSection.get_CSMEnabled ()
Amazon.Util.CSMConfig.Configure (Amazon.CSMSection section)
Amazon.Util.Internal.RootConfig..ctor ()
Amazon.AWSConfigs..cctor ()
Rethrow as TypeInitializationException: An exception was thrown by the type initializer for Amazon.AWSConfigs
Amazon.Runtime.ClientConfig..ctor ()
Amazon.GameLift.AmazonGameLiftConfig..ctor ()
Amazon.GameLift.AmazonGameLiftClient..ctor (System.String awsAccessKeyId, System.String awsSecretAccessKey, Amazon.RegionEndpoint region)


Is there anything I forgot to do?
I assume the root cause is I do not put app.config in the correct place.
So AWS SDK does not init correctly, but I have not found any tutorial for using Unity3d as Amazon GameLift client :(



My Environment:




  • OS: Mac OS X 10.14.1

  • Unity3d: 2018.2.12f1

  • AWS SDK Core: 3.3.29.10(.net35)

  • AWS SDK GameLift: 3.3.12.29(.net35)


Update:
The AWS SDK relies on System.ConfigurationManager which seems not available in Unity3d projects. It seems the root cause of the NullReferenceException.










share|improve this question

























  • First of all, the error gives all the details to debug it. Second, Google gives you the answers. This will help you understanding the issue -> stackoverflow.com/questions/4660142/…

    – Cabrra
    Nov 22 '18 at 14:09













  • This seems like a configuration issue; please provide the following details: Name the AWS SDK nuget packages you're using and which version they are on. Name the .NET framework you're on and which version it is. Any other relevant code leading up to this point or any other references you've made to the AWS SDK that executed up to this point would also be helpful for context. In the interim, make sure you're using the correct AWS SDK packages for your framework and that they are with the latest version. Also make sure you're using the correct AccessKey/SecretKey.

    – Anthony Neace
    Nov 22 '18 at 16:32













  • @AnthonyNeace you are right. It should be a configuration issue. I have no idea where to put the app.config in a Unity3d project. I am trying to figure it out.

    – Yongyi
    Nov 24 '18 at 3:26











  • I'm experiencing this issue as well after upgrading the aws sdk. @AnthonyNeace this is entry point to the api. You make a config before making a client to do other things so there is no other context. Cabrra's comment is also really shallow and unhelpful. This NRE happens within the default constructor of the config classes so there must be some kind of non-obvious external setup that needs to be done now. Perhaps some kind of factory method?

    – Jayd16
    Nov 28 '18 at 23:49














4












4








4


0






I use below code to create GameClient in Unity3d:



AmazonGameLiftClient client = 
new AmazonGameLiftClient("accessKeyId",
"accessKey",
RegionEndpoint.CNNorth1);


Above code is the first line in Awake(), no any other leading codes.



I get below error:



NullReferenceException: Object reference not set to an instance of an object
Amazon.CSMSection.get_CSMEnabled ()
Amazon.Util.CSMConfig.Configure (Amazon.CSMSection section)
Amazon.Util.Internal.RootConfig..ctor ()
Amazon.AWSConfigs..cctor ()
Rethrow as TypeInitializationException: An exception was thrown by the type initializer for Amazon.AWSConfigs
Amazon.Runtime.ClientConfig..ctor ()
Amazon.GameLift.AmazonGameLiftConfig..ctor ()
Amazon.GameLift.AmazonGameLiftClient..ctor (System.String awsAccessKeyId, System.String awsSecretAccessKey, Amazon.RegionEndpoint region)


Is there anything I forgot to do?
I assume the root cause is I do not put app.config in the correct place.
So AWS SDK does not init correctly, but I have not found any tutorial for using Unity3d as Amazon GameLift client :(



My Environment:




  • OS: Mac OS X 10.14.1

  • Unity3d: 2018.2.12f1

  • AWS SDK Core: 3.3.29.10(.net35)

  • AWS SDK GameLift: 3.3.12.29(.net35)


Update:
The AWS SDK relies on System.ConfigurationManager which seems not available in Unity3d projects. It seems the root cause of the NullReferenceException.










share|improve this question
















I use below code to create GameClient in Unity3d:



AmazonGameLiftClient client = 
new AmazonGameLiftClient("accessKeyId",
"accessKey",
RegionEndpoint.CNNorth1);


Above code is the first line in Awake(), no any other leading codes.



I get below error:



NullReferenceException: Object reference not set to an instance of an object
Amazon.CSMSection.get_CSMEnabled ()
Amazon.Util.CSMConfig.Configure (Amazon.CSMSection section)
Amazon.Util.Internal.RootConfig..ctor ()
Amazon.AWSConfigs..cctor ()
Rethrow as TypeInitializationException: An exception was thrown by the type initializer for Amazon.AWSConfigs
Amazon.Runtime.ClientConfig..ctor ()
Amazon.GameLift.AmazonGameLiftConfig..ctor ()
Amazon.GameLift.AmazonGameLiftClient..ctor (System.String awsAccessKeyId, System.String awsSecretAccessKey, Amazon.RegionEndpoint region)


Is there anything I forgot to do?
I assume the root cause is I do not put app.config in the correct place.
So AWS SDK does not init correctly, but I have not found any tutorial for using Unity3d as Amazon GameLift client :(



My Environment:




  • OS: Mac OS X 10.14.1

  • Unity3d: 2018.2.12f1

  • AWS SDK Core: 3.3.29.10(.net35)

  • AWS SDK GameLift: 3.3.12.29(.net35)


Update:
The AWS SDK relies on System.ConfigurationManager which seems not available in Unity3d projects. It seems the root cause of the NullReferenceException.







amazon-web-services unity3d aws-sdk aws-sdk-net amazon-gamelift






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Dec 2 '18 at 7:45







Yongyi

















asked Nov 22 '18 at 13:29









YongyiYongyi

417




417













  • First of all, the error gives all the details to debug it. Second, Google gives you the answers. This will help you understanding the issue -> stackoverflow.com/questions/4660142/…

    – Cabrra
    Nov 22 '18 at 14:09













  • This seems like a configuration issue; please provide the following details: Name the AWS SDK nuget packages you're using and which version they are on. Name the .NET framework you're on and which version it is. Any other relevant code leading up to this point or any other references you've made to the AWS SDK that executed up to this point would also be helpful for context. In the interim, make sure you're using the correct AWS SDK packages for your framework and that they are with the latest version. Also make sure you're using the correct AccessKey/SecretKey.

    – Anthony Neace
    Nov 22 '18 at 16:32













  • @AnthonyNeace you are right. It should be a configuration issue. I have no idea where to put the app.config in a Unity3d project. I am trying to figure it out.

    – Yongyi
    Nov 24 '18 at 3:26











  • I'm experiencing this issue as well after upgrading the aws sdk. @AnthonyNeace this is entry point to the api. You make a config before making a client to do other things so there is no other context. Cabrra's comment is also really shallow and unhelpful. This NRE happens within the default constructor of the config classes so there must be some kind of non-obvious external setup that needs to be done now. Perhaps some kind of factory method?

    – Jayd16
    Nov 28 '18 at 23:49



















  • First of all, the error gives all the details to debug it. Second, Google gives you the answers. This will help you understanding the issue -> stackoverflow.com/questions/4660142/…

    – Cabrra
    Nov 22 '18 at 14:09













  • This seems like a configuration issue; please provide the following details: Name the AWS SDK nuget packages you're using and which version they are on. Name the .NET framework you're on and which version it is. Any other relevant code leading up to this point or any other references you've made to the AWS SDK that executed up to this point would also be helpful for context. In the interim, make sure you're using the correct AWS SDK packages for your framework and that they are with the latest version. Also make sure you're using the correct AccessKey/SecretKey.

    – Anthony Neace
    Nov 22 '18 at 16:32













  • @AnthonyNeace you are right. It should be a configuration issue. I have no idea where to put the app.config in a Unity3d project. I am trying to figure it out.

    – Yongyi
    Nov 24 '18 at 3:26











  • I'm experiencing this issue as well after upgrading the aws sdk. @AnthonyNeace this is entry point to the api. You make a config before making a client to do other things so there is no other context. Cabrra's comment is also really shallow and unhelpful. This NRE happens within the default constructor of the config classes so there must be some kind of non-obvious external setup that needs to be done now. Perhaps some kind of factory method?

    – Jayd16
    Nov 28 '18 at 23:49

















First of all, the error gives all the details to debug it. Second, Google gives you the answers. This will help you understanding the issue -> stackoverflow.com/questions/4660142/…

– Cabrra
Nov 22 '18 at 14:09







First of all, the error gives all the details to debug it. Second, Google gives you the answers. This will help you understanding the issue -> stackoverflow.com/questions/4660142/…

– Cabrra
Nov 22 '18 at 14:09















This seems like a configuration issue; please provide the following details: Name the AWS SDK nuget packages you're using and which version they are on. Name the .NET framework you're on and which version it is. Any other relevant code leading up to this point or any other references you've made to the AWS SDK that executed up to this point would also be helpful for context. In the interim, make sure you're using the correct AWS SDK packages for your framework and that they are with the latest version. Also make sure you're using the correct AccessKey/SecretKey.

– Anthony Neace
Nov 22 '18 at 16:32







This seems like a configuration issue; please provide the following details: Name the AWS SDK nuget packages you're using and which version they are on. Name the .NET framework you're on and which version it is. Any other relevant code leading up to this point or any other references you've made to the AWS SDK that executed up to this point would also be helpful for context. In the interim, make sure you're using the correct AWS SDK packages for your framework and that they are with the latest version. Also make sure you're using the correct AccessKey/SecretKey.

– Anthony Neace
Nov 22 '18 at 16:32















@AnthonyNeace you are right. It should be a configuration issue. I have no idea where to put the app.config in a Unity3d project. I am trying to figure it out.

– Yongyi
Nov 24 '18 at 3:26





@AnthonyNeace you are right. It should be a configuration issue. I have no idea where to put the app.config in a Unity3d project. I am trying to figure it out.

– Yongyi
Nov 24 '18 at 3:26













I'm experiencing this issue as well after upgrading the aws sdk. @AnthonyNeace this is entry point to the api. You make a config before making a client to do other things so there is no other context. Cabrra's comment is also really shallow and unhelpful. This NRE happens within the default constructor of the config classes so there must be some kind of non-obvious external setup that needs to be done now. Perhaps some kind of factory method?

– Jayd16
Nov 28 '18 at 23:49





I'm experiencing this issue as well after upgrading the aws sdk. @AnthonyNeace this is entry point to the api. You make a config before making a client to do other things so there is no other context. Cabrra's comment is also really shallow and unhelpful. This NRE happens within the default constructor of the config classes so there must be some kind of non-obvious external setup that needs to be done now. Perhaps some kind of factory method?

– Jayd16
Nov 28 '18 at 23:49












1 Answer
1






active

oldest

votes


















1














Please refer to this answer, it completely solves this question.






share|improve this answer

























    Your Answer






    StackExchange.ifUsing("editor", function () {
    StackExchange.using("externalEditor", function () {
    StackExchange.using("snippets", function () {
    StackExchange.snippets.init();
    });
    });
    }, "code-snippets");

    StackExchange.ready(function() {
    var channelOptions = {
    tags: "".split(" "),
    id: "1"
    };
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function() {
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled) {
    StackExchange.using("snippets", function() {
    createEditor();
    });
    }
    else {
    createEditor();
    }
    });

    function createEditor() {
    StackExchange.prepareEditor({
    heartbeatType: 'answer',
    autoActivateHeartbeat: false,
    convertImagesToLinks: true,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: 10,
    bindNavPrevention: true,
    postfix: "",
    imageUploader: {
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    },
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    });


    }
    });














    draft saved

    draft discarded


















    StackExchange.ready(
    function () {
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53432086%2ffailed-to-create-amazongameliftclient-in-unity3d%23new-answer', 'question_page');
    }
    );

    Post as a guest















    Required, but never shown

























    1 Answer
    1






    active

    oldest

    votes








    1 Answer
    1






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    1














    Please refer to this answer, it completely solves this question.






    share|improve this answer






























      1














      Please refer to this answer, it completely solves this question.






      share|improve this answer




























        1












        1








        1







        Please refer to this answer, it completely solves this question.






        share|improve this answer















        Please refer to this answer, it completely solves this question.







        share|improve this answer














        share|improve this answer



        share|improve this answer








        edited Dec 20 '18 at 7:30

























        answered Dec 2 '18 at 7:26









        YongyiYongyi

        417




        417






























            draft saved

            draft discarded




















































            Thanks for contributing an answer to Stack Overflow!


            • Please be sure to answer the question. Provide details and share your research!

            But avoid



            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.


            To learn more, see our tips on writing great answers.




            draft saved


            draft discarded














            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53432086%2ffailed-to-create-amazongameliftclient-in-unity3d%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown







            Popular posts from this blog

            404 Error Contact Form 7 ajax form submitting

            How to know if a Active Directory user can login interactively

            Refactoring coordinates for Minecraft Pi buildings written in Python