gpt4 book ai didi

c# - 下载在门户上创建的机器人会导致解决方案无效/无法运行

转载 作者:行者123 更新时间:2023-11-30 12:40:13 24 4
gpt4 key购买 nike

我前往 Azure 门户尝试 Bot 框架。我按照这些步骤创建了一个 Proactive 机器人。

没有进行任何更改,我进入配置持续集成并下载了 zip 文件。

当我尝试在 Visual Studio 2015 中打开该 SLN 文件时,打开解决方案时出现以下错误:

Popup error

输出窗口在解决方案下拉列表中显示此内容:

Some of the properties associated with the solution could not be read.

这是解决方案资源管理器的屏幕截图:

solution explorer

然后我按 F5 进行测试...

running it

它应该正在运行吗?我应该做点什么吗?

最佳答案

编辑:目前,本地调试 Azure Function 应用程序(这是由 Bot 服务创建的应用程序类型)有些复杂。 Azure SDK 2.9.6 和 3.0 之间的流程也发生了变化。 VS2017 的工具也在发生一些变化:.NET Web Development and Tools Blog

Update 3-10-2017: This preview copy of Azure Functions Tools does not work with the newly released Azure SDK 3.0. If you want to continue using these tools on Visual Studio 2015, you will need to remain on the 2.9.6 SDK. Additionally, there are no Azure Function Tools currently available for Visual Studio 2017. We are actively working on the 2017 tools, and will provide an update in the next few weeks regarding our plans and strategy.

<小时/>

本杰明·珀金斯 (Benjamin Perkins) 的这篇博文有一个很好的演练:https://blogs.msdn.microsoft.com/benjaminperkins/2016/12/01/how-i-tested-my-chatbot-that-i-created-using-the-bot-services-on-azure/

<小时/>

还有这个:Debugging Bots Built using Azure Bot Service on Windows

The C# environment in Azure Bot Service has more in common with Node.js than a typical C# app because it requires a runtime host, much like the Node engine. In Azure, the runtime is part of the hosting environment in the cloud, but you’ll need to replicate that environment locally on your desktop.

首先,您需要设置环境。你需要:

  1. A local copy of your Azure Bot Service code (see Setting up Continuous Integration )
  2. The Bot Framework Emulator
  3. The Azure Functions CLI
  4. DotNet CLI

and if you want breakpoint debugging in Visual Studio 15:

  1. Visual Studio 15—the Community Edition will work fine
  2. The Command Task Runner Visual Studio Extension

After installing the tools above, you have everything you need to debug your C# bot locally.

Open a command prompt and navigate to the folder where your project.json file lives in your repository. Issue the command dotnet restore to restore the various packages referenced in your bot.

Note: Visual Studio 2017 RC is changing how it handles dependencies from a project.json to a .csproj model when loading in Visual Studio. As a result, you will need to download the csproj here: https://aka.ms/bf-debug-project and save the .csproj into your /repo/messages folder before running the dotnet restore command.

请注意,这些也是要求: Azure 2.9.6 .NET SDK
Visual Studio Tools for Azure Functions

<小时/>

这是:https://blogs.msdn.microsoft.com/appserviceteam/2017/03/16/publishing-a-net-class-library-as-a-function-app/您将找到有关如何从 Visual Studio 发布函数应用程序以及如何在 Visual Studio 中下载和执行现有函数应用程序的说明。

  1. Install the Azure Functions CLI from npm. If you’ve installed the Visual Studio Tools for Azure Functions, just add func.exe to your path from %USERPROFILE%\AppData\Local\Azure.Functions.Cli\1.0.0-beta.93 (or the latest version on your machine).

  2. Go to the Kudu console for your Function App in Function App Settings -> Kudu. Navigate to site and click on the download icon to the left of wwwroot (click on the animated gif below). Or, from an authenticated session, go to https://[YOURFUNCTIONAPP].scm.azurewebsites.net/api/zip/site/wwwroot/.

  3. Unzip the file wwwroot.zip on your local machine. From that directory, run the following:

func azure login
func azure functionapp list
func azure functionapp fetch-app-settings [name]

This will create a local file called appsettings.json. These settings are only used locally by the Functions CLI. Since this file contains secrets, be sure not to check this file in to source control! (The Azure Functions CLI adds appsettings.json to .gitignore for you.)

Copy your downloaded files to the web project folder (including appsettings.json). Include the script files and function.json in the project. F5 should now work and successfully attach a debugger.

关于c# - 下载在门户上创建的机器人会导致解决方案无效/无法运行,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42557344/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com