在非 MVC 或基于 Web 的项目中使用 Postal
我们正在开发一个 Windows 服务,它在给定的时间需要发送电子邮件。我们正在尝试使用 Postal ( https://github.com/andrewdavey/postal ) 来渲染一些模板。
我们现在面临的问题应该是缺少配置。这是错误消息:
D:\SVNV3\SalesCompensation\trunk\SalesCompensation.Application.Tests\Templates\Emails\NoSePudoCompensar.cshtml: ASP.NET 运行时错误:没有为该注册的构建提供程序 扩展名“.cshtml”。您可以在 machine.config 或 web.config 中的部分。 确保具有 BuildProviderAppliesToAttribute 属性 包括值“Web”或 '全部'。 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>
We are working on a Windows Service, which at a given time needs to send an e-mail. We are trying to use Postal ( https://github.com/andrewdavey/postal ) to render some templates.
The problem which we are facing now, is supposedly a missing config. Here is the error message:
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
I can't find the right config! I get the same when trying with:
<compilation>
<buildProviders>
<add extension=".cshtml"
type="System.Web.WebPages.Razor.RazorBuildProvider,
System.Web.WebPages.Razor"/>
</buildProviders> </compilation>
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
试试这个:
Try this :