我們正在開發Windows服務,在給定時間需要發送電子郵件。我們正試圖使用郵政(https://github.com/andrewdavey/postal)來呈現一些模板。在非MVC或基於Web的項目中使用郵政
我們現在面臨的問題,應該是一個缺失的配置。這裏是錯誤信息:
D:\SVNV3\SalesCompensation\trunk\SalesCompensation.Application.Tests\Templates\Emails\NoSePudoCompensar.cshtml: ASP.NET runtime error: There is no build provider registered for the extension '.cshtml'. You can register one in the section in machine.config or web.config. Make sure is has a BuildProviderAppliesToAttribute attribute which includes the value 'Web' or 'All'. D:\SVNV3\SalesCompensation\trunk\SalesCompensation.Application.Tests\Templates\Emails\NoSePudoCompensar.cshtml 1 1 SalesCompensation.Application.Tests
我無法找到正確的配置!嘗試時我會得到相同的結果:
<compilation>
<buildProviders>
<add extension=".cshtml"
type="System.Web.WebPages.Razor.RazorBuildProvider,
System.Web.WebPages.Razor"/>
</buildProviders> </compilation>
謝謝!