I'm trying to write an azure function which will use Sendgrid to send emails. However, I can't get my function to recognize the external nuget package. Here's what I have:
project.json
{"frameworks": {"net46": {"dependencies": {"SendGrid": "9.9.0" } } }}
run.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();}
I get this error:
[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?)
What am I missing?