Asp.net mvc 4 HTML帮助程序无法识别“@Html.InlineImage“;

Asp.net mvc 4 HTML帮助程序无法识别“@Html.InlineImage“;,asp.net-mvc-4,email,razor,html-helper,mvcmailer,Asp.net Mvc 4,Email,Razor,Html Helper,Mvcmailer,我正在尝试在MVCMailer中嵌入电子邮件图像。Github MvcMailer分步指南确实提供了如下所示的解决方案: 分步指南: //Place this in the View: @Html.InlineImage("logo", "Company Logo") //Place this in the mailer: var resources = new Dictionary<string, string>(); resources["logo"] = logoPath;

我正在尝试在MVCMailer中嵌入电子邮件图像。Github MvcMailer分步指南确实提供了如下所示的解决方案:

分步指南:

//Place this in the View:
@Html.InlineImage("logo", "Company Logo")

//Place this in the mailer:
var resources = new Dictionary<string, string>();
resources["logo"] = logoPath;
PopulateBody(mailMessage, "WelcomeMessage", resources);
//将其放置在视图中:
@Html.InlineImage(“徽标”、“公司徽标”)
//将此邮件放入邮箱:
var resources=newdictionary();
资源[“logo”]=logoPath;
PopulateBody(mailMessage,“WelcomeMessage”,参考资料);
我的问题是,视图无法识别
@Html.InlineImage
。它识别其他html帮助程序,而不是“InlineImage”。事实上,当我键入
@Html
时,它从来都不是智能意义上的


我认为MVC4不支持这一点。有谁能给我指出正确的方向,告诉我需要做什么才能让它正常工作吗?

我没有弄清楚@Html.InlineImage的问题,但我确实找到了解决办法。简单地使用:
在我看来,我解决了这个问题。谢谢大家的帮助。

我没有解决@Html.InlineImage问题,但我确实找到了解决办法。简单地使用:
在我看来,我解决了这个问题。感谢大家寻求帮助。

我知道为时已晚,但我解决了问题,在电子邮件视图顶部添加了“@using Mvc.Mailer;”。

我知道为时已晚,但我解决了问题,在电子邮件视图顶部添加了“@using Mvc.Mailer;”。

,下面是我收到的错误消息:编译器错误消息:CS1061:“System.Web.Mvc.HtmlHelper”不包含“InlineImage”的定义,并且找不到接受类型为“System.Web.Mvc.HtmlHelper”的第一个参数的扩展方法“InlineImage”(是否缺少using指令或程序集引用?)确保您具有该视图范围的真实配置。检查本地web.config文件内容。我们假设您包含了项目的相关程序集引用。仅供参考,下面是我收到的错误消息:编译器错误消息:CS1061:'System.Web.Mvc.HtmlHelper'不包含'InlineImage'的定义,并且找不到接受'System.Web.Mvc.HtmlHelper'类型的第一个参数的扩展方法'InlineImage'(是否缺少using指令或程序集引用?)。