Quantcast
Channel: Can't use Nuget package in C# Azure function - Stack Overflow
Viewing all articles
Browse latest Browse all 2

Can't use Nuget package in C# Azure function

$
0
0

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?


Viewing all articles
Browse latest Browse all 2

Trending Articles





<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>