找不到类型或命名空间名称“Web”

编程入门 行业动态 更新时间:2024-10-13 00:37:57
本文介绍了找不到类型或命名空间名称“Web”的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

所以我对此感到有点盲目。

So I am feeling a little snow blind with this.

似乎当我尝试创建一个Web实例时,似乎有误。我在这里遵循一个教程,所以这是意料之外的,我不能为我的生活看到哪里我错了或丢失了什么。

It seems like when I try to create an instance of Web it seems to error. I am following a tutorial here and so this is unexpected and I cannot for the life of me see where I am going wrong or whats missing.

// Create a Web transport for sending email. var transportWeb = new Web(credentials);

using System; using System.Collections.Generic; using System.Data.Entity; using System.Linq; using System.Security.Claims; using System.Threading.Tasks; using System.Web; using System.Xml; using Microsoft.Web; using System.Net.Mime; using Microsoft.AspNet.Identity; using Microsoft.AspNet.Identity.EntityFramework; using Microsoft.AspNet.Identity.Owin; using Microsoft.Owin; using Microsoft.Owin.Security; using HecticHousehold.Models; using SendGrid; using System.Net; using System.Configuration; using System.Diagnostics; using SendGrid.Helpers.Mail; using System.Net.Mail; using System.Web.UI; using System.Web.UI.WebControls; namespace HecticHousehold { public class EmailService : IIdentityMessageService { public async Task SendAsync(IdentityMessage message) { await configSendGridasync(message); } // Use NuGet to install SendGrid (Basic C# client lib) private async Task configSendGridasync(IdentityMessage message) { var myMessage = new SendGridMessage(); myMessage.AddTo(message.Destination); myMessage.From = new EmailAddress("Joe@contoso", "Joe S."); myMessage.Subject = message.Subject; myMessage.PlainTextContent = message.Body; myMessage.HtmlContent = message.Body; var credentials = new NetworkCredential( ConfigurationManager.AppSettings["mailAccount"], ConfigurationManager.AppSettings["mailPassword"] ); // Create a Web transport for sending email. var transportWeb = new Web(credentials);

推荐答案

您应该在某些背景下发布教程的链接。 You should post the link for the tutorial for some context.

更多推荐

找不到类型或命名空间名称“Web”

本文发布于:2023-11-24 23:44:55,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1627399.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:找不到   名称   类型   空间   Web

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!