【问题标题】:No jobs functions found未找到工作职能
【发布时间】:2018-07-08 08:35:02
【问题描述】:

我正在尝试在 Visual Studio 上使用 azure 功能制作预定邮件,但这次我发现没有找到作业功能错误。如何修复和发送这些邮件? 我也在 Azure 门户上制作了这个功能,它可以工作。我正在尝试转换 Visual Studio。

using System;
using SendGrid.Helpers.Mail;
using Microsoft.Azure.WebJobs.Host;
using Microsoft.Azure.WebJobs;


namespace FifteenMinMail
{
    public class Program
    {
        public static void Main()
        {
            JobHostConfiguration config = new JobHostConfiguration();
            config.UseTimers();
            JobHost host = new JobHost(config);
            host.RunAndBlock();
        }
    }
    public class ScheduledMail
    {

        public static Mail Run(TimerInfo myTimer, TraceWriter log)
        {
            JobHostConfiguration config = new JobHostConfiguration();
            config.UseTimers();
            JobHost host = new JobHost(config);
            var today = DateTime.Today.ToShortDateString();
            log.Info($"Generating daily report for {today} at {DateTime.Now}");

            Mail message = new Mail()
            {
                Subject = "15 DK'LIK TEST MAILI"
            };

            Content content = new Content
            {
                Type = "text/plain",
                Value = "Bu mail 15 dk da bir yinelenecektir."
            };

            message.AddContent(content);
            return message;
        }
    }
}

错误; https://imgur.com/pyyctnC

【问题讨论】:

    标签: c# azure azure-functions sendgrid


    【解决方案1】:

    您将网络作业和天蓝色功能混为一谈。 这些是不同但相关的技术。 如果您想在 Visual Studio 中创建 azure 函数,请查看此内容: https://docs.microsoft.com/en-us/azure/azure-functions/functions-create-your-first-function-visual-studio

    【讨论】:

      猜你喜欢
      • 2018-05-20
      • 1970-01-01
      • 2020-09-12
      • 2022-06-15
      • 2014-07-11
      • 2013-04-13
      • 2019-02-12
      • 1970-01-01
      • 2018-09-09
      相关资源
      最近更新 更多