kud*_*ger 6 azure azure-functions azure-functions-runtime
在 Visual Studio 中创建 Azure Function 的步骤如下
Azure Function
模板IoT Hub Trigger
生成的代码但有参考错误。
using IoTHubTrigger = Microsoft.Azure.WebJobs.EventHubTriggerAttribute;
using Microsoft.Azure.WebJobs;
using Microsoft.Azure.WebJobs.Host;
using Microsoft.Azure.EventHubs;
using System.Text;
using System.Net.Http;
using Microsoft.Extensions.Logging;
namespace DeviceMessageFunction_v2
{
public static class Function1
{
private static HttpClient client = new HttpClient();
[FunctionName("Function1")]
public static void Run([IoTHubTrigger("messages/events", Connection = "")]EventData message, ILogger log)
{
log.LogInformation($"C# IoT Hub trigger function processed a message: {Encoding.UTF8.GetString(message.Body.Array)}");
}
}
}
Run Code Online (Sandbox Code Playgroud)CS0234 命名空间“Microsoft.Azure.WebJobs”中不存在类型或命名空间名称“EventHubTriggerAttribute”(您是否缺少程序集引用?)DeviceMessageFunction_v2 C:\Functions\DeviceMessageFunction_v2\Function1.cs
尝试添加引用,但没有运气
这是我的工具和框架详细信息
归档时间: |
|
查看次数: |
2049 次 |
最近记录: |