Reference to type ‘HttpContextBase’ claims it is defined in ‘System.Web’ but it could not be found

I’m getting a really weird error that I’ve only found a few times with some pretty extensive googling. I’m making an authorization attribute to add onto my Actions in an ASP.NET MVC project in a class library. I installed the ASP packages through NuGet and can use intellisense to get the HttpContext from the filterContext, but it’s saying that the HttpContext type can’t be found where it’s supposed to be.

How to send email using GMAIL API having HTML body + attachment in ASP.NET

var msg = new AE.Net.Mail.MailMessage { Subject = subject, Body = bodyhtml, From = new System.Net.Mail.MailAddress("myemail") }; foreach (string add in vendorEmailList.Split(',')) { if (string.IsNullOrEmpty(add)) continue; msg.To.Add(new System.Net.Mail.MailAddress(add)); } msg.ReplyTo.Add(msg.From); // Bounces without this!! msg.ContentType = "text/html"; ////attachment code foreach (string path in attachments) { var bytes = File.ReadAllBytes(path); string mimeType = MimeMapping.GetMimeMapping(path); AE.Net.Mail.Attachment attachment … Read more