我正在尝试编写一个将使用 Sendgrid 发送电子邮件的天蓝色函数。但是,我无法让我的功能识别外部 nuget 包。这是我所拥有的:
项目.json
{
"frameworks": {
"net46": {
"dependencies": {
"SendGrid": "9.9.0"
}
}
}
}
运行.csx:
using System;
using Sendgrid;
public static void Run(TimerInfo myTimer, TraceWriter log)
{
var client = new SendGridClient("xxx");
var fromAddr = new EmailAddress("xxx@xxx.com", "xxx");
var toAddr = new EmailAddress("xxxx", "xxx);
var msg = MailHelper.CreateSingleEmail(fromAddr, toAddr, "subject", "content", "content");
client.SendEmailAsync(msg).Wait();
}
我收到此错误:
[Error] run.csx(8,7): error CS0246: The type or namespace name 'Sendgrid' could not be found (are you missing a using directive or an assembly reference?)
我错过了什么?