找不到类型或命名空间名称“Web” [英] The type or namespace name 'Web' could not be found

查看:108
本文介绍了找不到类型或命名空间名称“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.com", "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”的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆