函数的侦听器无法启动。为什么? [英] The listener for function was unable to start. Why?

查看:139
本文介绍了函数的侦听器无法启动。为什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

从Visual Studio运行azure函数时遇到以下错误。

I'm getting the following error when I run the azure function from visual studio.


发生ScriptHost错误[1 / 19/2018 6:40:52 AM]函数 MyFunctionName的侦听器
无法启动。
Microsoft.WindowsAzure.Storage:服务器遇到内部错误。
请过一段时间再试。

A ScriptHost error has occurred [1/19/2018 6:40:52 AM] The listener for function 'MyFunctionName' was unable to start. Microsoft.WindowsAzure.Storage: Server encountered an internal error. Please try again after some time.

当我通过运行 func从命令提示符运行时主机启动命令。我收到以下警告。然后卡在

When I run from the command prompt by running func host start command. I get the following warning. and then it gets stuck on


实例ID获得的主机锁租约中

Host lock lease acquired by instance ID


未找到作业功能。尝试将您的工作类别和方法
公开。如果您使用绑定扩展名(例如ServiceBus,Timer,
等),请确保已在启动代码(例如config.UseServiceBus())中调用了
扩展名的注册方法。 ,
config.UseTimers()等)。

No job functions found. Try making your job classes and methods public. If you're using binding extensions (e.g. ServiceBus, Timers, etc.) make sure you've called the registration method for the extension(s) in your startup code (e.g. config.UseServiceBus(), config.UseTimers(), etc.).

Azure函数版本: azure- functions-core-tools@2.0.1-beta.22
我正在使用存储帐户Blob容器和队列。

Azure function version: azure-functions-core-tools@2.0.1-beta.22 I'm using Storage Accounts Blob containers and queues.

我正在连接到 Development Storage帐户,已检查是否已启动存储模拟器

I'm connecting to Development Storage account, I have checked it that storage emulator is started.

{
  "IsEncrypted": false,
  "Values": {
    "ConnectionStrings:Default": "Server=.\\SQLEXPRESS; Database=TestDb; Trusted_Connection=True;",
    "ConnectionStrings:BlobStorageAccount": "UseDevelopmentStorage=true",

    "AzureWebJobsStorage": "UseDevelopmentStorage=true",
    "AzureWebJobsDashboard": "UseDevelopmentStorage=true",
  }
}

仅供参考。

以前工作正常,但是我在Visual Studio中收到了此消息。

It was working fine before, But I have got this message in Visual Studio.


您的许可证已过时,必须更新。检查更新的
许可以继续使用该产品

your license has gone stale and must be updated. Check for an updated license to continue using this product

所以我只是删除了%localappdata%%temp%,然后我尝试运行Azure函数,此后,我开始获取

So I just deleted the %localappdata% and %temp%, then I tried to run Azure function and after this, I have started getting


函数的侦听器无法启动错误

The listener for function was unable to start error

那么这与我的Visual Studio订阅有关还是我误删除了任何必需的文件?还是这与其他问题有关?

So is it related to my visual studio subscription or I mistakenly deleted any required file? Or is this related to something else?

推荐答案

我不知道此问题的根本原因,但我通过以下方法解决了只需将相同的代码复制到PC上的其他位置即可。我多次遇到此问题,每次将项目复制到其他位置都可以正常使用。

I don't know the root cause of this issue, but I solved it by just copying the same code to a different location on my PC. I faced this issue many times and every time I have copied the project to the different location and it always works.

您可以跟踪此问题此处

这篇关于函数的侦听器无法启动。为什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆