带有Mvc5的MvcMailer失败了

时间:2014-01-14 19:57:46

标签: asp.net-mvc-5 mvcmailer

例外:

Attempt by method 'System.Web.Mvc.VirtualPathProviderViewEngine.GetPath(System.Web.Mvc.ControllerContext, System.String[], System.String[], System.String, System.String, System.String, System.String, Boolean, System.String[] ByRef)' to access method 'System.Web.Mvc.VirtualPathProviderViewEngine.get_DisplayModeProvider()' failed.

代码抛出:

return Populate(x =>
            {
                x.ViewName = "MyView";
                x.Subject = "[" + vm.FriendlyName + "] [" + DepResolver.DaemonAppSettingsHelper().EnvironmentName + "] [Status: " + vm.FriendlySuceeded + "]";
                x.To.Add(DepResolver.DaemonAppSettingsHelper().TaskEmailRecipient);
            });

如何解决此问题>?

1 个答案:

答案 0 :(得分:0)

将项目更新为包含MVCMailer的MVC5时遇到了困难。以下版本安装解决了它。

安装包MvcMailer-vs2013 -Pre

此处有进一步说明:https://github.com/smsohan/MvcMailer/wiki/MvcMailer-Step-by-Step-Guide