How to see all references/calls to keys in app.config or web.config in a visual studio solution?











up vote
1
down vote

favorite












The question: Using Visual Studio, it's possible to see all references to classes/methods, etc. Is there a way to do the same for app.config/web.config keys?



The situation/details: I have 3 keys in a web.config as part of a botframework solution: MicrosoftAppId, MicrosoftAppPassword, and DataStore.



Searching for "ConfigurationManager.AppSettings", I only get one result: a reference to the DataStore key, which I added myself. I cannot find any references to the other keys. I've also searched the entire solution for the names of both keys, and I get no results. The bot framework docs indicate the purpose of these keys (https://docs.microsoft.com/en-us/azure/bot-service/bot-service-troubleshoot-authentication-problems?view=azure-bot-service-4.0) and the bot doesn't work if I comment them out, so I know they are being called somewhere, but I need help finding where.



The reason I am trying to find where these keys are called in the code is: I need to move these keys/values to a different, encrypted file, and will need to know where the code needs to be redirected to the new location.



Thanks in advance!










share|improve this question
























  • Do you need to see where these are utilized throughout the code or just the point at which they are loaded in from the config file? Generally all the samples include a file such as (Startup.cs)[github.com/Microsoft/BotBuilder-Samples/blob/master/samples/… which includes the code to load those keys into the bot. Otherwise looking through the dotnet SDK itself for where these are utilized is an option, but a lot more involved.
    – Mark B
    Nov 12 at 23:03










  • Thanks! I was looking for the point at which they are loaded from the config file. Apparently that's done in the bot framework sdk. I'm using asp.net, and therefore do not have startup.cs. However, I did find a good example of how to implement a custom credential provider and a custom constructor for the Messages Controller, and the combination of those two things resolved the issue. Link to example: github.com/Microsoft/botbuilder-dotnet/issues/689
    – redmondcoffehead
    Nov 13 at 0:56












  • Sounds good, it might be good to post your solution as an answer to this so it's easier to find later on.
    – Mark B
    Nov 13 at 0:59















up vote
1
down vote

favorite












The question: Using Visual Studio, it's possible to see all references to classes/methods, etc. Is there a way to do the same for app.config/web.config keys?



The situation/details: I have 3 keys in a web.config as part of a botframework solution: MicrosoftAppId, MicrosoftAppPassword, and DataStore.



Searching for "ConfigurationManager.AppSettings", I only get one result: a reference to the DataStore key, which I added myself. I cannot find any references to the other keys. I've also searched the entire solution for the names of both keys, and I get no results. The bot framework docs indicate the purpose of these keys (https://docs.microsoft.com/en-us/azure/bot-service/bot-service-troubleshoot-authentication-problems?view=azure-bot-service-4.0) and the bot doesn't work if I comment them out, so I know they are being called somewhere, but I need help finding where.



The reason I am trying to find where these keys are called in the code is: I need to move these keys/values to a different, encrypted file, and will need to know where the code needs to be redirected to the new location.



Thanks in advance!










share|improve this question
























  • Do you need to see where these are utilized throughout the code or just the point at which they are loaded in from the config file? Generally all the samples include a file such as (Startup.cs)[github.com/Microsoft/BotBuilder-Samples/blob/master/samples/… which includes the code to load those keys into the bot. Otherwise looking through the dotnet SDK itself for where these are utilized is an option, but a lot more involved.
    – Mark B
    Nov 12 at 23:03










  • Thanks! I was looking for the point at which they are loaded from the config file. Apparently that's done in the bot framework sdk. I'm using asp.net, and therefore do not have startup.cs. However, I did find a good example of how to implement a custom credential provider and a custom constructor for the Messages Controller, and the combination of those two things resolved the issue. Link to example: github.com/Microsoft/botbuilder-dotnet/issues/689
    – redmondcoffehead
    Nov 13 at 0:56












  • Sounds good, it might be good to post your solution as an answer to this so it's easier to find later on.
    – Mark B
    Nov 13 at 0:59













up vote
1
down vote

favorite









up vote
1
down vote

favorite











The question: Using Visual Studio, it's possible to see all references to classes/methods, etc. Is there a way to do the same for app.config/web.config keys?



The situation/details: I have 3 keys in a web.config as part of a botframework solution: MicrosoftAppId, MicrosoftAppPassword, and DataStore.



Searching for "ConfigurationManager.AppSettings", I only get one result: a reference to the DataStore key, which I added myself. I cannot find any references to the other keys. I've also searched the entire solution for the names of both keys, and I get no results. The bot framework docs indicate the purpose of these keys (https://docs.microsoft.com/en-us/azure/bot-service/bot-service-troubleshoot-authentication-problems?view=azure-bot-service-4.0) and the bot doesn't work if I comment them out, so I know they are being called somewhere, but I need help finding where.



The reason I am trying to find where these keys are called in the code is: I need to move these keys/values to a different, encrypted file, and will need to know where the code needs to be redirected to the new location.



Thanks in advance!










share|improve this question















The question: Using Visual Studio, it's possible to see all references to classes/methods, etc. Is there a way to do the same for app.config/web.config keys?



The situation/details: I have 3 keys in a web.config as part of a botframework solution: MicrosoftAppId, MicrosoftAppPassword, and DataStore.



Searching for "ConfigurationManager.AppSettings", I only get one result: a reference to the DataStore key, which I added myself. I cannot find any references to the other keys. I've also searched the entire solution for the names of both keys, and I get no results. The bot framework docs indicate the purpose of these keys (https://docs.microsoft.com/en-us/azure/bot-service/bot-service-troubleshoot-authentication-problems?view=azure-bot-service-4.0) and the bot doesn't work if I comment them out, so I know they are being called somewhere, but I need help finding where.



The reason I am trying to find where these keys are called in the code is: I need to move these keys/values to a different, encrypted file, and will need to know where the code needs to be redirected to the new location.



Thanks in advance!







asp.net visual-studio botframework






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Nov 13 at 1:34









Mark B

498212




498212










asked Nov 9 at 23:12









redmondcoffehead

166




166












  • Do you need to see where these are utilized throughout the code or just the point at which they are loaded in from the config file? Generally all the samples include a file such as (Startup.cs)[github.com/Microsoft/BotBuilder-Samples/blob/master/samples/… which includes the code to load those keys into the bot. Otherwise looking through the dotnet SDK itself for where these are utilized is an option, but a lot more involved.
    – Mark B
    Nov 12 at 23:03










  • Thanks! I was looking for the point at which they are loaded from the config file. Apparently that's done in the bot framework sdk. I'm using asp.net, and therefore do not have startup.cs. However, I did find a good example of how to implement a custom credential provider and a custom constructor for the Messages Controller, and the combination of those two things resolved the issue. Link to example: github.com/Microsoft/botbuilder-dotnet/issues/689
    – redmondcoffehead
    Nov 13 at 0:56












  • Sounds good, it might be good to post your solution as an answer to this so it's easier to find later on.
    – Mark B
    Nov 13 at 0:59


















  • Do you need to see where these are utilized throughout the code or just the point at which they are loaded in from the config file? Generally all the samples include a file such as (Startup.cs)[github.com/Microsoft/BotBuilder-Samples/blob/master/samples/… which includes the code to load those keys into the bot. Otherwise looking through the dotnet SDK itself for where these are utilized is an option, but a lot more involved.
    – Mark B
    Nov 12 at 23:03










  • Thanks! I was looking for the point at which they are loaded from the config file. Apparently that's done in the bot framework sdk. I'm using asp.net, and therefore do not have startup.cs. However, I did find a good example of how to implement a custom credential provider and a custom constructor for the Messages Controller, and the combination of those two things resolved the issue. Link to example: github.com/Microsoft/botbuilder-dotnet/issues/689
    – redmondcoffehead
    Nov 13 at 0:56












  • Sounds good, it might be good to post your solution as an answer to this so it's easier to find later on.
    – Mark B
    Nov 13 at 0:59
















Do you need to see where these are utilized throughout the code or just the point at which they are loaded in from the config file? Generally all the samples include a file such as (Startup.cs)[github.com/Microsoft/BotBuilder-Samples/blob/master/samples/… which includes the code to load those keys into the bot. Otherwise looking through the dotnet SDK itself for where these are utilized is an option, but a lot more involved.
– Mark B
Nov 12 at 23:03




Do you need to see where these are utilized throughout the code or just the point at which they are loaded in from the config file? Generally all the samples include a file such as (Startup.cs)[github.com/Microsoft/BotBuilder-Samples/blob/master/samples/… which includes the code to load those keys into the bot. Otherwise looking through the dotnet SDK itself for where these are utilized is an option, but a lot more involved.
– Mark B
Nov 12 at 23:03












Thanks! I was looking for the point at which they are loaded from the config file. Apparently that's done in the bot framework sdk. I'm using asp.net, and therefore do not have startup.cs. However, I did find a good example of how to implement a custom credential provider and a custom constructor for the Messages Controller, and the combination of those two things resolved the issue. Link to example: github.com/Microsoft/botbuilder-dotnet/issues/689
– redmondcoffehead
Nov 13 at 0:56






Thanks! I was looking for the point at which they are loaded from the config file. Apparently that's done in the bot framework sdk. I'm using asp.net, and therefore do not have startup.cs. However, I did find a good example of how to implement a custom credential provider and a custom constructor for the Messages Controller, and the combination of those two things resolved the issue. Link to example: github.com/Microsoft/botbuilder-dotnet/issues/689
– redmondcoffehead
Nov 13 at 0:56














Sounds good, it might be good to post your solution as an answer to this so it's easier to find later on.
– Mark B
Nov 13 at 0:59




Sounds good, it might be good to post your solution as an answer to this so it's easier to find later on.
– Mark B
Nov 13 at 0:59












1 Answer
1






active

oldest

votes

















up vote
1
down vote



accepted










For the first question, "Using Visual Studio, it's possible to see all references to classes/methods, etc. Is there a way to do the same for app.config/web.config keys?" -- I've found that the answer is no.



Regarding how to see where the bot framework is calling the appid and password, apparently that's done in the bot framework sdk.



Regarding how to point the code to load appid and password from elsewhere, here is a good example of how to implement a custom credential provider and a custom constructor for the Messages Controller: https://github.com/Microsoft/botbuilder-dotnet/issues/689. This resolved the issue.






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',
    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%2f53234437%2fhow-to-see-all-references-calls-to-keys-in-app-config-or-web-config-in-a-visual%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








    up vote
    1
    down vote



    accepted










    For the first question, "Using Visual Studio, it's possible to see all references to classes/methods, etc. Is there a way to do the same for app.config/web.config keys?" -- I've found that the answer is no.



    Regarding how to see where the bot framework is calling the appid and password, apparently that's done in the bot framework sdk.



    Regarding how to point the code to load appid and password from elsewhere, here is a good example of how to implement a custom credential provider and a custom constructor for the Messages Controller: https://github.com/Microsoft/botbuilder-dotnet/issues/689. This resolved the issue.






    share|improve this answer



























      up vote
      1
      down vote



      accepted










      For the first question, "Using Visual Studio, it's possible to see all references to classes/methods, etc. Is there a way to do the same for app.config/web.config keys?" -- I've found that the answer is no.



      Regarding how to see where the bot framework is calling the appid and password, apparently that's done in the bot framework sdk.



      Regarding how to point the code to load appid and password from elsewhere, here is a good example of how to implement a custom credential provider and a custom constructor for the Messages Controller: https://github.com/Microsoft/botbuilder-dotnet/issues/689. This resolved the issue.






      share|improve this answer

























        up vote
        1
        down vote



        accepted







        up vote
        1
        down vote



        accepted






        For the first question, "Using Visual Studio, it's possible to see all references to classes/methods, etc. Is there a way to do the same for app.config/web.config keys?" -- I've found that the answer is no.



        Regarding how to see where the bot framework is calling the appid and password, apparently that's done in the bot framework sdk.



        Regarding how to point the code to load appid and password from elsewhere, here is a good example of how to implement a custom credential provider and a custom constructor for the Messages Controller: https://github.com/Microsoft/botbuilder-dotnet/issues/689. This resolved the issue.






        share|improve this answer














        For the first question, "Using Visual Studio, it's possible to see all references to classes/methods, etc. Is there a way to do the same for app.config/web.config keys?" -- I've found that the answer is no.



        Regarding how to see where the bot framework is calling the appid and password, apparently that's done in the bot framework sdk.



        Regarding how to point the code to load appid and password from elsewhere, here is a good example of how to implement a custom credential provider and a custom constructor for the Messages Controller: https://github.com/Microsoft/botbuilder-dotnet/issues/689. This resolved the issue.







        share|improve this answer














        share|improve this answer



        share|improve this answer








        edited Nov 13 at 20:22

























        answered Nov 13 at 1:00









        redmondcoffehead

        166




        166






























            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.





            Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


            Please pay close attention to the following guidance:


            • 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%2f53234437%2fhow-to-see-all-references-calls-to-keys-in-app-config-or-web-config-in-a-visual%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







            這個網誌中的熱門文章

            Tangent Lines Diagram Along Smooth Curve

            Yusuf al-Mu'taman ibn Hud

            Zucchini