Azure Bot Framework 模拟器错误 - System.ArgumentNullException:值不能为 null

2024-02-21

我需要一些帮助。我是 Azure 机器人框架开发新手,几周前使用 QnA 知识库创建了我的第一个聊天机器人。无论如何,我设法在 Azure 门户中创建了机器人,并且它运行良好。但我需要在 Bot Framework Emulator(使用 V4)中进行一些更改和测试,为此,需要在本地下载并运行我的机器人。

我按照 Azure 的说明下载了机器人的 .zip 文件,并使用 Visual Studio 2017 作为 IDE 对其进行了初始化。但是,当我点击“调试”按钮时,程序会尝试连接到本地主机:3984.

using Autofac;
using System.Web.Http;
using System.Configuration;
using System.Reflection;
using Microsoft.Bot.Builder.Azure;
using Microsoft.Bot.Builder.Dialogs;
using Microsoft.Bot.Builder.Dialogs.Internals;
using Microsoft.Bot.Connector;

namespace SimpleEchoBot
{
    public class WebApiApplication : System.Web.HttpApplication
    {
        protected void Application_Start()
        {
            // Bot Storage: This is a great spot to register the private state storage for your bot. 
            // We provide adapters for Azure Table, CosmosDb, SQL Azure, or you can implement your own!
            // For samples and documentation, see: https://github.com/Microsoft/BotBuilder-Azure

            Conversation.UpdateContainer(
                builder =>
                {
                    builder.RegisterModule(new AzureModule(Assembly.GetExecutingAssembly()));

                    // Using Azure Table Storage

                    var store = new TableBotDataStore(ConfigurationManager.AppSettings["AzureWebJobsStorage"]); // requires Microsoft.BotBuilder.Azure Nuget package 

                    // To use CosmosDb or InMemory storage instead of the default table storage, uncomment the corresponding line below
                    // var store = new DocumentDbBotDataStore("cosmos db uri", "cosmos db key"); // requires Microsoft.BotBuilder.Azure Nuget package 
                    // var store = new InMemoryDataStore(); // volatile in-memory store

                    builder.Register(c => store)
                        .Keyed<IBotDataStore<BotData>>(AzureModule.Key_DataStore)
                        .AsSelf()
                        .SingleInstance();

                });
            GlobalConfiguration.Configure(WebApiConfig.Register);
        }
    }
}

不过,几秒钟后,以下代码行就会返回错误System.ArgumentNullException: '值不能为空。 Arg_ParamName_Name':

var store = new TableBotDataStore(ConfigurationManager.AppSettings["AzureWebJobsStorage"]); // requires Microsoft.BotBuilder.Azure Nuget package 

因此,我无法在 Bot Framework Emulator 中测试我的机器人。由于我对 C# 非常陌生,有人可以帮我解决这个问题吗?

EDIT:这是我的 web.config 部分代码,只是删除了敏感数据:

<?xml version="1.0" encoding="utf-8"?>
<!--
  For more information on how to configure your ASP.NET application, please visit
  http://go.microsoft.com/fwlink/?LinkId=301879
  -->
<configuration>
  <configSections>
    <!-- For more information on Entity Framework configuration, visit http://go.microsoft.com/fwlink/?LinkID=237468 -->
    <section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
  </configSections>
  <appSettings>
    <!-- update these with your Microsoft App Id and your Microsoft App Password-->
    <!--<add key="BotId" value="" />-->
    <add key="MicrosoftAppId" value="" />
    <add key="MicrosoftAppPassword" value="" />
    <add key="QnaSubscriptionKey" value="" />
    <add key="QnaKnowledgebaseId" value="" />
    <add key="AzureWebJobsStorage" value="" />

  </appSettings>
  <!--
    For a description of web.config changes see http://go.microsoft.com/fwlink/?LinkId=235367.

    The following attributes can be set on the <httpRuntime> tag.
      <system.Web>
        <httpRuntime targetFramework="4.6" />
      </system.Web>
  -->
  <system.web>
    <customErrors mode="Off" />
    <compilation debug="true" targetFramework="4.6" />
    <httpRuntime targetFramework="4.6" />
  </system.web>
  <system.webServer>
    <defaultDocument>
      <files>
        <clear />
        <add value="default.htm" />
      </files>
    </defaultDocument>
    <handlers>
      <remove name="ExtensionlessUrlHandler-Integrated-4.0" />
      <remove name="OPTIONSVerbHandler" />
      <remove name="TRACEVerbHandler" />
      <add name="ExtensionlessUrlHandler-Integrated-4.0" path="*." verb="*" type="System.Web.Handlers.TransferRequestHandler" preCondition="integratedMode,runtimeVersionv4.0" />
    </handlers>
  </system.webServer>
  <runtime>
    <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
      <dependentAssembly>
        <assemblyIdentity name="System.Web.Helpers" publicKeyToken="31bf3856ad364e35" />
        <bindingRedirect oldVersion="1.0.0.0-3.0.0.0" newVersion="3.0.0.0" />
      </dependentAssembly>
      <dependentAssembly>
        <assemblyIdentity name="System.Web.Mvc" publicKeyToken="31bf3856ad364e35" />
        <bindingRedirect oldVersion="1.0.0.0-5.2.3.0" newVersion="5.2.3.0" />
      </dependentAssembly>
      <dependentAssembly>
        <assemblyIdentity name="System.Web.WebPages" publicKeyToken="31bf3856ad364e35" />
        <bindingRedirect oldVersion="1.0.0.0-3.0.0.0" newVersion="3.0.0.0" />
      </dependentAssembly>
      <dependentAssembly>
        <assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" />
        <bindingRedirect oldVersion="0.0.0.0-9.0.0.0" newVersion="9.0.0.0" />
      </dependentAssembly>
      <dependentAssembly>
        <assemblyIdentity name="System.Net.Http.Primitives" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
        <bindingRedirect oldVersion="0.0.0.0-4.2.29.0" newVersion="4.2.29.0" />
      </dependentAssembly>
      <dependentAssembly>
        <assemblyIdentity name="System.Net.Http.Formatting" publicKeyToken="31bf3856ad364e35" culture="neutral" />
        <bindingRedirect oldVersion="0.0.0.0-5.2.3.0" newVersion="5.2.3.0" />
      </dependentAssembly>
      <dependentAssembly>
        <assemblyIdentity name="System.IdentityModel.Tokens.Jwt" publicKeyToken="31bf3856ad364e35" culture="neutral" />
        <bindingRedirect oldVersion="0.0.0.0-5.1.4.0" newVersion="5.1.4.0" />
      </dependentAssembly>
      <dependentAssembly>
        <assemblyIdentity name="Microsoft.IdentityModel.Protocol.Extensions" publicKeyToken="31bf3856ad364e35" culture="neutral" />
        <bindingRedirect oldVersion="0.0.0.0-1.0.40306.1554" newVersion="1.0.40306.1554" />
      </dependentAssembly>
      <dependentAssembly>
        <assemblyIdentity name="Microsoft.Bot.Connector" publicKeyToken="31bf3856ad364e35" culture="neutral" />
        <bindingRedirect oldVersion="0.0.0.0-3.15.2.2" newVersion="3.15.2.2" />
      </dependentAssembly>
      <dependentAssembly>
        <assemblyIdentity name="Microsoft.Bot.Builder" publicKeyToken="31bf3856ad364e35" culture="neutral" />
        <bindingRedirect oldVersion="0.0.0.0-3.15.2.2" newVersion="3.15.2.2" />
      </dependentAssembly>
      <dependentAssembly>
        <assemblyIdentity name="Microsoft.Azure.Documents.Client" publicKeyToken="31bf3856ad364e35" culture="neutral" />
        <bindingRedirect oldVersion="0.0.0.0-1.11.0.0" newVersion="1.11.0.0" />
      </dependentAssembly>
      <dependentAssembly>
        <assemblyIdentity name="Microsoft.Bot.Builder.History" publicKeyToken="31bf3856ad364e35" culture="neutral" />
        <bindingRedirect oldVersion="0.0.0.0-3.12.2.4" newVersion="3.12.2.4" />
      </dependentAssembly>
      <dependentAssembly>
        <assemblyIdentity name="Microsoft.Bot.Builder.Autofac" publicKeyToken="31bf3856ad364e35" culture="neutral" />
        <bindingRedirect oldVersion="0.0.0.0-3.15.2.2" newVersion="3.15.2.2" />
      </dependentAssembly>
      <dependentAssembly>
        <assemblyIdentity name="Microsoft.Data.Services.Client" publicKeyToken="31bf3856ad364e35" culture="neutral" />
        <bindingRedirect oldVersion="0.0.0.0-5.7.0.0" newVersion="5.7.0.0" />
      </dependentAssembly>
      <dependentAssembly>
        <assemblyIdentity name="Microsoft.Data.OData" publicKeyToken="31bf3856ad364e35" culture="neutral" />
        <bindingRedirect oldVersion="0.0.0.0-5.7.0.0" newVersion="5.7.0.0" />
      </dependentAssembly>
      <dependentAssembly>
        <assemblyIdentity name="Microsoft.Data.Edm" publicKeyToken="31bf3856ad364e35" culture="neutral" />
        <bindingRedirect oldVersion="0.0.0.0-5.7.0.0" newVersion="5.7.0.0" />
      </dependentAssembly>
    </assemblyBinding>
  </runtime>
  <system.codedom>
    <compilers>
      <compiler language="c#;cs;csharp" extension=".cs" type="Microsoft.CodeDom.Providers.DotNetCompilerPlatform.CSharpCodeProvider, Microsoft.CodeDom.Providers.DotNetCompilerPlatform, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" warningLevel="4" compilerOptions="/langversion:6 /nowarn:1659;1699;1701" />
      <compiler language="vb;vbs;visualbasic;vbscript" extension=".vb" type="Microsoft.CodeDom.Providers.DotNetCompilerPlatform.VBCodeProvider, Microsoft.CodeDom.Providers.DotNetCompilerPlatform, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" warningLevel="4" compilerOptions="/langversion:14 /nowarn:41008 /define:_MYTYPE=\&quot;Web\&quot; /optionInfer+" />
    </compilers>
  </system.codedom>
  <entityFramework>
    <defaultConnectionFactory type="System.Data.Entity.Infrastructure.LocalDbConnectionFactory, EntityFramework">
      <parameters>
        <parameter value="mssqllocaldb" />
      </parameters>
    </defaultConnectionFactory>
    <providers>
      <provider invariantName="System.Data.SqlClient" type="System.Data.Entity.SqlServer.SqlProviderServices, EntityFramework.SqlServer" />
    </providers>
  </entityFramework>
</configuration>

EDIT 2: Some screenshots of the issue so far: enter image description here

EDIT 3: 正在努力解决“请在应用程序设置中设置 QnAKnowledgebaseId、QnAAuthKey 和 QnAEndpointHostName(如果适用)。了解如何获取它们,请访问https://aka.ms/qnaabssetup https://aka.ms/qnaabssetup."。到目前为止,基本的 QnAMakerDialog.cs(qnaAuthKey、qnaKBId 和 endpointHostName 的第一个实例具有归因于它们的值,但为了安全起见,我在此处删除了它们):

using System;
using System.Threading;
using System.Threading.Tasks;

using Microsoft.Bot.Builder.Azure;
using Microsoft.Bot.Builder.Dialogs;
using Microsoft.Bot.Builder.CognitiveServices.QnAMaker;
using Microsoft.Bot.Connector;
using System.Configuration;
namespace Microsoft.Bot.Sample.QnABot
{
    [Serializable]
    public class RootDialog : IDialog<object>
    {
        public async Task StartAsync(IDialogContext context)
        {
            /* Wait until the first message is received from the conversation and call MessageReceviedAsync 
            *  to process that message. */
            context.Wait(this.MessageReceivedAsync);
        }

        private async Task MessageReceivedAsync(IDialogContext context, IAwaitable<IMessageActivity> result)
        {
            /* When MessageReceivedAsync is called, it's passed an IAwaitable<IMessageActivity>. To get the message,
             *  await the result. */
            var message = await result;

            var qnaAuthKey = GetSetting("");
            var qnaKBId = ConfigurationManager.AppSettings[""];
            var endpointHostName = ConfigurationManager.AppSettings[""];

            // QnA Subscription Key and KnowledgeBase Id null verification
            if (!string.IsNullOrEmpty(qnaAuthKey) && !string.IsNullOrEmpty(qnaKBId))
            {
                // Forward to the appropriate Dialog based on whether the endpoint hostname is present
                if (string.IsNullOrEmpty(endpointHostName))
                    await context.Forward(new BasicQnAMakerPreviewDialog(), AfterAnswerAsync, message, CancellationToken.None);
                else
                    await context.Forward(new BasicQnAMakerDialog(), AfterAnswerAsync, message, CancellationToken.None);
            }
            else
            {
                await context.PostAsync("Please set QnAKnowledgebaseId, QnAAuthKey and QnAEndpointHostName (if applicable) in App Settings. Learn how to get them at https://aka.ms/qnaabssetup.");
            }

        }

        private async Task AfterAnswerAsync(IDialogContext context, IAwaitable<IMessageActivity> result)
        {
            // wait for the next user message
            context.Wait(MessageReceivedAsync);
        }

        public static string GetSetting(string key)
        {
            var value = ConfigurationManager.AppSettings[key];
            if (String.IsNullOrEmpty(value) && key == "QnAAuthKey")
            {
                value = ConfigurationManager.AppSettings["QnASubscriptionKey"]; // QnASubscriptionKey for backward compatibility with QnAMaker (Preview)
            }
            return value;
        }
    }

    // Dialog for QnAMaker Preview service
    [Serializable]
    public class BasicQnAMakerPreviewDialog : QnAMakerDialog
    {
        // Go to https://qnamaker.ai and feed data, train & publish your QnA Knowledgebase.
        // Parameters to QnAMakerService are:
        // Required: subscriptionKey, knowledgebaseId, 
        // Optional: defaultMessage, scoreThreshold[Range 0.0 – 1.0]
        public BasicQnAMakerPreviewDialog() : base(new QnAMakerService(new QnAMakerAttribute(RootDialog.GetSetting("QnAAuthKey"), ConfigurationManager.AppSettings["QnAKnowledgebaseId"], "No good match in FAQ.", 0.5)))
        { }
    }

    // Dialog for QnAMaker GA service
    [Serializable]
    public class BasicQnAMakerDialog : QnAMakerDialog
    {
        // Go to https://qnamaker.ai and feed data, train & publish your QnA Knowledgebase.
        // Parameters to QnAMakerService are:
        // Required: qnaAuthKey, knowledgebaseId, endpointHostName
        // Optional: defaultMessage, scoreThreshold[Range 0.0 – 1.0]
        public BasicQnAMakerDialog() : base(new QnAMakerService(new QnAMakerAttribute(RootDialog.GetSetting("QnAAuthKey"), ConfigurationManager.AppSettings["QnAKnowledgebaseId"], "Desculpe, não entendi muito bem sua pergunta... Poderia refazê-la de forma diferente? Caso já tenha tentado, talvez eu ainda não saiba como responder sua dúvida.", 0.3, 1, ConfigurationManager.AppSettings["QnAEndpointHostName"])))
        { }

    }
}

As the error mentions, the problem here is that, AzureWebJobsStorage cannot be found in the web.config file. To fix your problem, navigate to your bot in azure portal and click on app settings from the left blade. There you will find a setting with the key AzureWebJobsStorage. enter image description here Copy the value of the setting and paste that in the web.config file as :

<configuration>
  <appSettings>
    <!-- update these with your BotId, Microsoft App Id and your Microsoft App Password-->
    <add key="BotId" value="YourBotId" />
   <add key="MicrosoftAppId" value="" />
   <add key="MicrosoftAppPassword" value="" />
    <add key="QnaSubscriptionKey" value="" />
    <add key="QnaKnowledgebaseId" value="" />
    <add key="AzureWebJobsStorage" value="copied value from azure portal" />
  </appSettings>

Update:

为了回答您在评论中提出的进一步问题,

我被重定向到浏览器中的空白页面,其中包含地址 localhost:3984 和可在其中阅读 QnABot 模板的文本,后面是一些链接

表示机器人现在工作正常,这实际上是预期的行为。 要在本地测试机器人,您需要使用机器人模拟器 https://learn.microsoft.com/en-us/azure/bot-service/bot-service-debug-emulator?view=azure-bot-service-3.0。按照链接中提到的步骤操作并测试机器人。您也可以通过机器人框架 https://learn.microsoft.com/en-us/azure/bot-service/?view=azure-bot-service-3.0链接,因为这将使您更清楚地了解 Microsoft Bot Framework。

更新2:

根据您发布的屏幕截图,我认为您已经更改了Global.asax文件。 注册代码TableBotDataStore应该正是

var store = new TableBotDataStore(ConfigurationManager.AppSettings["AzureWebJobsStorage"]); 

对此没有任何改变。

其次,正如韩非所说:

The Utils.GetAppSetting(string key)方法适用于在 Azure 上运行的机器人,如果您想在本地运行机器人应用程序并从 web.config 文件访问设置,您可以使用ConfigurationManager.AppSettings[“your_key”]取代Utils.GetAppSetting(“your_key”)在您的 QnAMakerDialog 中。

第二个屏幕截图显示您仍然有Utils.GetAppSetting(“your_key”)在你的代码中。将其替换为:

var qnaKBId = ConfigurationManager.AppSettings["QnAKnowledgebaseId"];

其他地方也是如此。

本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

Azure Bot Framework 模拟器错误 - System.ArgumentNullException:值不能为 null 的相关文章

  • 在 HKCR 中创建新密钥有效,但不起作用

    我有以下代码 它返回 成功 但使用两种不同的工具使用搜索字符串 3BDAAC43 E734 11D5 93AF 00105A990292 搜索注册表不会产生任何结果 RegistryKey RK Registry ClassesRoot C
  • 尝试了解使用服务打开对话框

    我已经阅读了有关使用 mvvm 模式打开对话框的讨论 我看过几个使用服务的示例 但我不明白所有部分如何组合在一起 我发布这个问题寻求指导 以了解我应该阅读哪些内容 以更好地理解我所缺少的内容 我将在下面发布我所拥有的内容 它确实有效 但从我
  • Grpc - 将消息从一个客户端发送到连接到同一服务器的另一个客户端

    是否可以将消息从一个客户端发送到连接到同一服务器的另一个客户端 我想将数据从一个客户端发送到服务器然后发送到特定客户端 我想我需要获取客户端 ID 但我不知道如何获取此 ID 以及如何从服务器将此消息发送到该客户端 我这里有一个样本 这是一
  • Http 标头已删除 Azure Web 应用程序

    我在 Azure 上托管的 Web 应用程序遇到问题 该应用程序是一个用于身份验证 授权的identityserver4应用程序 asp net core 此应用程序可以在本地运行 但不能在 Azure 上运行 通过跟踪来自服务器的响应标头
  • 传递 constexpr 对象

    我决定给予新的C 14的定义constexpr旋转并充分利用它 我决定编写一个小的编译时字符串解析器 然而 我正在努力保持我的对象constexpr将其传递给函数时 考虑以下代码 include
  • 有些有助于理解“产量”

    在我不断追求少吸的过程中 我试图理解 产量 的说法 但我不断遇到同样的错误 someMethod 的主体不能是迭代器块 因为 System Collections Generic List 不是迭代器接口类型 这是我被卡住的代码 forea
  • 在 C# 中,如何根据在 gridview 行中单击的按钮引用特定产品记录

    我有一个显示产品网格视图的页面 该表内有一列 其中有一个名为 详细信息 的超链接 我想这样做 以便如果用户单击该特定产品的详细信息单元格 将打开一个新页面 提供有关该产品的更多信息 我不确定如何确定哪个Product记录链接的详细信息以及我
  • Eigen 和 OpenMP:由于错误共享和线程开销而没有并行化

    系统规格 Intel Xeon E7 v3 处理器 4 插槽 16 核 插槽 2 线程 核心 Eigen 系列和 C 的使用 以下是代码片段的串行实现 Eigen VectorXd get Row const int j const int
  • 如何将AVFrame转换为glTexImage2D使用的纹理?

    如您所知 AVFrame 有 2 个属性 pFrame gt data pFrame gt linesize 当我从视频 sdcard test mp4 android平台 读取帧后 并将其转换为RGB AVFrame副 img conve
  • 如何递归取消引用指针(C++03)?

    我正在尝试在 C 中递归地取消引用指针 如果传递一个对象 那就是not一个指针 这包括智能指针 我只想返回对象本身 如果可能的话通过引用返回 我有这个代码 template
  • 从 C# 使用 Odbc 调用 Oracle 包函数

    我在 Oracle 包中定义了一个函数 CREATE OR REPLACE PACKAGE BODY TESTUSER TESTPKG as FUNCTION testfunc n IN NUMBER RETURN NUMBER as be
  • 如果输入被重定向则执行操作

    我想知道如果我的输入被重定向 我应该如何在 C 程序中执行操作 例如 假设我有已编译的程序 prog 并且我将输入 input txt 重定向到它 我这样做 prog lt input txt 我如何在代码中检测到这一点 一般来说 您无法判
  • 将二变量 std::function 转换为单变量 std::function

    我有一个函数 它获取两个值 x 和 y 并返回结果 std function lt double double double gt mult double x double y return x y 现在我想得到一个常量 y 的单变量函数
  • 将函数参数类型提取为参数包

    这是一个后续问题 解包 元组以调用匹配的函数指针 https stackoverflow com questions 7858817 unpacking a tuple to call a matching function pointer
  • 比较:接口方法、虚方法、抽象方法

    它们各自的优点和缺点是什么 接口方法 虚拟方法 抽象方法 什么时候应该选择什么 做出这一决定时应牢记哪些要点 虚拟和抽象几乎是一样的 虚方法在基类中有一个实现 可以选择重写 而抽象方法则没有 并且must在子类中被覆盖 否则它们是相同的 在
  • 使动态创建的链接标签在 Winforms 中可点击

    我正在制作一个程序 允许用户单击由动态链接标签创建的公司名称 在我想知道如何做到这一点之前 我从未在 C 中使用过链接标签 可为特定用户生成的业务数量各不相同 因此每个用户的链接标签数量并不相同 然后我想捕获业务 ID 以进行 Json 调
  • 代码中的.net Access Forms身份验证“超时”值

    我正在向我的应用程序添加注销过期警报 并希望从我的代码访问我的 web config 表单身份验证 超时 值 我有什么办法可以做到这一点吗 我认为您可以从 FormsAuthentication 静态类方法中读取它 这比直接读取 web c
  • Visual Studio 2015 - Web 项目上缺少共享项目参考选项卡

    我从 MSDN 订阅升级到 Visual Studio 2015 因为我非常兴奋地阅读有关共享项目的信息 当我们想要做的只是重用代码时 不再需要在依赖项中管理 21382 个 nuget 包 所以我构建了一个测试共享项目 其中包含一些代码
  • 为什么空循环使用如此多的处理器时间?

    如果我的代码中有一个空的 while 循环 例如 while true 它将把处理器的使用率提高到大约 25 但是 如果我执行以下操作 while true Sleep 1 它只会使用大约1 那么这是为什么呢 更新 感谢所有精彩的回复 但我
  • 在 System.Type 上使用条件断点时出错

    这是函数 public void Init System Type Type this Type Type BuildFieldAttributes BuildDataColumns FieldAttributes 我在第一行设置了一个断点

随机推荐

  • 如何更改CUDA版本

    我在编译修改后的caffe版本时遇到了这个错误 OpenCV static library was compiled with CUDA 7 5 support Please use the same version or rebuild
  • 自由格式代码可以包含在固定格式代码中吗?

    我继承了一个固定格式文件 FFTRUN f 该文件的开头如下所示 SUBROUTINE FFTRUN 2e USE intrinsic ISO C BINDING USE FFTWmod ONLY FFTWplan fwd FFTWplan
  • 发布到 IIS 后启用 CORS 不起作用

    我将 dotnet core 2 2 Web api 应用程序托管到本地 IIS 当我运行托管网站时 网站正在运行 我正在尝试从角度登录 但它不起作用 It says 从源 http localhost 4200 访问位于 http 192
  • 如何在维护模式下使用 Nginx 提供静态资产(503)[重复]

    这个问题在这里已经有答案了 我在我的网站服务器上使用 Nginx 作为前端代理 我想用它来将用户重定向到我的 Web 应用程序 当它处于活动状态时 或当我处于维护模式时将用户重定向到维护 php 页面 这是我的服务器指令 server li
  • Node.js process.exit() 不会在 createReadStream 打开时退出

    我有一个通过 EAGI 与 Asterisk 通信的程序 Asterisk 打开我的 Node js 应用程序并通过 STDIN 向其发送数据 程序通过 STDOUT 发送 Asterisk 命令 当用户挂断电话时 Node js 进程会收
  • C *[] 和 ** 之间的区别

    这可能是一个有点基本的问题 但是写 char 和 char 有什么区别 例如 在 main 中 我可以有一个 char argv 或者我可以使用 char argv 我认为这两种符号之间一定存在某种差异 在这种情况下 根本没有区别 如果您尝
  • 如何在 Java 中向字符串添加换行符?

    在 Java 应用程序中 我创建一个如下所示的字符串 通过串联 String notaCorrente dataOdierna testoNotaCorrente 我的问题是我想在此字符串末尾添加类似 HTML 换行符的内容 将显示在 HT
  • 子串上的熔化和合并 - Python 和 Pandas

    我有数据 其中有类似的数据 id name model ms bp1 cd1 sf1 sa1 rq1 bp2 cd2 sf2 sa2 rq2 1 John 23984 1 23 234 124 25 252 252 62 194 234 2
  • 将参数传递给 AddHostedService

    我正在编写一个 Net Core Windows 服务 下面是一段代码 internal static class Program public static async Task Main string args var isServic
  • 如何使用 Swagger UI 访问 AWS API Gateway 文档

    我已经使用 AWS Api Gateway 创建了 API 然后我记录了所有实体的文档部分 如 API 资源 方法 模型等 然后使用 AWS Gateway Console 我已将文档发布到dev阶段与版本1 但我不确定我 或 API 的使
  • GWT - MVP 事件总线。创建多个处理程序

    我正在处理我继承的大型应用程序 并且遇到了一些最佳实践问题 每次用户导航到我们的客户编辑页面时 都会创建一个新的演示者并设置一个视图 有一个用于客户编辑的主演示者和一个主视图 主视图中还存在由主演示者的子演示者使用的子视图 在子演示者中 我
  • 3D numpy 数组转换为块对角矩阵

    我正在寻找一种将 nXaXb numpy 数组转换为块对角矩阵的方法 我已经遇到过scipy linalg block diag http docs scipy org doc scipy 0 13 0 reference generate
  • 内联块的水平滚动在 Firefox 中有效,但在 Chrome 中无效

    我已经在 Firefox 中实现了水平滚动 但在 Chrome 中不起作用 在 Firefox 中我遇到这种情况 其中 A B C D 是 div 但是当使用 Chrome 访问同一页面时 我看到的是 div 的结构如下 div class
  • 下载时进度条

    我有一个可进行应用内下载的应用程序 我通过以下方式成功下载了mp3文件 NSData data1 NSData dataWithContentsOfURL NSURL URLWithString http somefile mp3 data
  • “HTTP.SYS 中的 URL 保留”是什么意思?

    无法理解这句话的意思 论坛上的人们互相建议在 HTTP sys 中保留 url 但这意味着什么呢 它是做什么用的 它是如何运作的 这一切都来自于 HttpWebRequest uac 问题 一些 Win32 API 和 NET 框架组件 例
  • 百度的echarts - 填充两行之间的空间

    我想找到一种在 ECharts 中绘制两条线并填充它们之间的空间的方法 如下所示 这样每条线都有自己的颜色 根据线条的顺序 区域填充为一种颜色或另一种颜色 见图 有本地方法吗 我发现有些人在提到extensions 但没有人提供任何关于如何
  • 无法将 undefined 或 null 转换为 Next.js 中的对象

    嘿 我正在使用 Next js 和 next auth 构建一个登录页面 我还在providers数组中写过 nextauth js 但是当我运行代码 如下所示 时 import getProviders signIn from next
  • 我可以在移动应用程序的 PKCE Flow 中使用授权码吗?

    我知道 OAuth 2 0 授权代码与 PKCE 流程是 OAuth 的最佳实践 我们计划将它用于我们的 WEB 应用程序 但我不明白如何在不使用浏览器进行身份验证的情况下将此流程用于我的移动应用程序的本机用户体验 https medium
  • read() 函数的返回值是什么类型?

    我想从二进制文件中读取前 188 个字节 并检查第一个字符是否为0x47 代码如下 import os fp open try ts rb for i in range 100 buf fp read 188 if buf 0 x47 pr
  • Azure Bot Framework 模拟器错误 - System.ArgumentNullException:值不能为 null

    我需要一些帮助 我是 Azure 机器人框架开发新手 几周前使用 QnA 知识库创建了我的第一个聊天机器人 无论如何 我设法在 Azure 门户中创建了机器人 并且它运行良好 但我需要在 Bot Framework Emulator 使用