相关疑难解决方法(0)

“找不到类型或命名空间‘BlobTrigger’”

所以我是 C# 中 Azure 函数的新手,我正在尝试使用 BlobStorage 触发器在 Visual Studio 中创建。在遵循模板时,我得到了一个看起来像这样的文件:

using System;
using System.IO;
using Microsoft.Azure.WebJobs;
using Microsoft.Azure.WebJobs.Host.Triggers;
using Microsoft.Extensions.Logging;

namespace BasicAzureFunction
{
    public static class Function1
    {
        [FunctionName("Function1")]
        public static void Run([BlobTrigger("samples-workitems/{name}", Connection = "")]Stream myBlob, string name, ILogger log)
        {
            log.LogInformation($"C# Blob trigger function Processed blob\n Name:{name} \n Size: {myBlob.Length} Bytes");
        }
    }
}
Run Code Online (Sandbox Code Playgroud)

我总是收到这个错误:

The type or namespace name 'BlobTriggerAttribute' could not be found (are you missing a using directive or an assembly reference?)
Run Code Online (Sandbox Code Playgroud)

我很确定我有所有的包(这实际上是模板)。我错过了什么?

使用 .Net …

c# compiler-errors azure .net-core azure-functions

3
推荐指数
1
解决办法
1131
查看次数

标签 统计

.net-core ×1

azure ×1

azure-functions ×1

c# ×1

compiler-errors ×1