问题描述
我正在尝试创建一个Azure函数来发送电子邮件.我添加了以下代码,但是出现一个错误,即找不到SendGrid.我不想使用SendGrid绑定.
I am trying to create an Azure function that will send an email. I added the following codes, but I am having an error that the SendGrid could not be found. I don't want to use the SendGrid bindings.
#r"SendGrid"
#r "SendGrid"
使用 SendGrid.Helpers.Mail;
谢谢!!
Ariel
推荐答案
这是您需要做的.
-停止您的应用服务
-前往Kudu CMD
- Go to Kudu CMD
-编辑"extensions.csproj"
- edit the "extensions.csproj"
-添加< PackageReference Include ="Microsoft.Azure.WebJobs.Extensions.SendGrid"版本="3.0.0&"; /> 到"ItemGroup"内部的文件
- Add <PackageReference Include="Microsoft.Azure.WebJobs.Extensions.SendGrid" Version="3.0.0" /> to the file inside "ItemGroup"
-保存文件
-运行以下脚本:
dotnet build extensions.csproj -o bin --no-incremental --packages D:\ home \ .nuget
dotnet build extensions.csproj -o bin --no-incremental --packages D:\home\.nuget
这需要一段时间.
完成后,再次启动Function App,您现在应该可以引用SendGrid.
Once completed, start your Function App again, and you should now be able to reference SendGrid.
Mourten la Cour
Morten la Cour
这篇关于找不到元数据文件"SendGrid"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!