<tfoot id='7ztfN'></tfoot>

    1. <legend id='7ztfN'><style id='7ztfN'><dir id='7ztfN'><q id='7ztfN'></q></dir></style></legend>

          <bdo id='7ztfN'></bdo><ul id='7ztfN'></ul>
      1. <small id='7ztfN'></small><noframes id='7ztfN'>

        <i id='7ztfN'><tr id='7ztfN'><dt id='7ztfN'><q id='7ztfN'><span id='7ztfN'><b id='7ztfN'><form id='7ztfN'><ins id='7ztfN'></ins><ul id='7ztfN'></ul><sub id='7ztfN'></sub></form><legend id='7ztfN'></legend><bdo id='7ztfN'><pre id='7ztfN'><center id='7ztfN'></center></pre></bdo></b><th id='7ztfN'></th></span></q></dt></tr></i><div id='7ztfN'><tfoot id='7ztfN'></tfoot><dl id='7ztfN'><fieldset id='7ztfN'></fieldset></dl></div>

        调试测试时从 local.setting.json 读取值

        Read values from local.setting.json while debugging test(调试测试时从 local.setting.json 读取值)

        <tfoot id='mVw6v'></tfoot>
            <i id='mVw6v'><tr id='mVw6v'><dt id='mVw6v'><q id='mVw6v'><span id='mVw6v'><b id='mVw6v'><form id='mVw6v'><ins id='mVw6v'></ins><ul id='mVw6v'></ul><sub id='mVw6v'></sub></form><legend id='mVw6v'></legend><bdo id='mVw6v'><pre id='mVw6v'><center id='mVw6v'></center></pre></bdo></b><th id='mVw6v'></th></span></q></dt></tr></i><div id='mVw6v'><tfoot id='mVw6v'></tfoot><dl id='mVw6v'><fieldset id='mVw6v'></fieldset></dl></div>
              <bdo id='mVw6v'></bdo><ul id='mVw6v'></ul>
                  <tbody id='mVw6v'></tbody>
                  <legend id='mVw6v'><style id='mVw6v'><dir id='mVw6v'><q id='mVw6v'></q></dir></style></legend>

                  <small id='mVw6v'></small><noframes id='mVw6v'>

                  本文介绍了调试测试时从 local.setting.json 读取值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  在运行或调试测试时,我似乎无法在 azure 函数中从该文件中读取任何内容,但是在本地调试整个应用程序时它工作正常.. 任何人都可以解释为什么吗?

                  i don't seem to be able to read anything from this file in an azure functions when running or debugging a test, however it works fine when debugging the whole application locally.. can anyone explain why at all ?

                  {
                    "IsEncrypted": false,
                    "Values": {
                      "xyz": 123
                    }
                  }
                  
                  var res = ConfigurationManager.AppSettings.Get("xyz");
                  

                  ty..

                  我怀疑是因为调试"是从另一个项目(测试项目)启动的,而 local.settings.json 没有与正在测试的项目捆绑在一起?

                  my suspicion is that it is due to the 'debug' being initiated from another project (Test project), and the local.settings.json does not get bundled up with the project being tested ?

                  推荐答案

                  你的怀疑是正确的.只有 Azure Functions 运行时主机真正知道从该文件中读取设置并将它们合并到整体 AppSettings 中.在测试项目中运行时,不涉及 Azure Functions 运行时主机,因此您无法访问它们.

                  Your suspicion is spot on. Only the Azure Functions Runtime Host actually knows to read settings from that file and merge them into the overall AppSettings. When you run in a test project, the Azure Functions Runtime Host is not involved and therefore you don't get access to them.

                  解决这个问题的最简单方法是将所有相同的设置键/值反映到标准<下的测试项目的app.config文件中.appSettings> 部分.

                  The simplest way to solve this would be to reflect all the same setting keys/values into your test project's app.config file under the standard <appSettings> section.

                  这篇关于调试测试时从 local.setting.json 读取值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

                  相关文档推荐

                  Adding and removing users from Active Directory groups in .NET(在 .NET 中的 Active Directory 组中添加和删除用户)
                  set equality in linq(在 linq 中设置相等)
                  HashSet conversion to List(HashSet 转换为 List)
                  How to set timeout for webBrowser navigate event(如何为 webBrowser 导航事件设置超时)
                  Test whether two IEnumerablelt;Tgt; have the same values with the same frequencies(测试两个IEnumerablelt;Tgt;具有相同频率的相同值)
                  How do you determine if two HashSets are equal (by value, not by reference)?(您如何确定两个 HashSet 是否相等(按值,而不是按引用)?)
                  <legend id='Asux5'><style id='Asux5'><dir id='Asux5'><q id='Asux5'></q></dir></style></legend>

                          <bdo id='Asux5'></bdo><ul id='Asux5'></ul>
                          <i id='Asux5'><tr id='Asux5'><dt id='Asux5'><q id='Asux5'><span id='Asux5'><b id='Asux5'><form id='Asux5'><ins id='Asux5'></ins><ul id='Asux5'></ul><sub id='Asux5'></sub></form><legend id='Asux5'></legend><bdo id='Asux5'><pre id='Asux5'><center id='Asux5'></center></pre></bdo></b><th id='Asux5'></th></span></q></dt></tr></i><div id='Asux5'><tfoot id='Asux5'></tfoot><dl id='Asux5'><fieldset id='Asux5'></fieldset></dl></div>
                          • <tfoot id='Asux5'></tfoot>
                              <tbody id='Asux5'></tbody>

                            <small id='Asux5'></small><noframes id='Asux5'>