1

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>
Jason Aller
  • 3,541
  • 28
  • 38
  • 38
Pato
  • 679
  • 8
  • 24

1 Answers1

1

Try this :

<system.web>
    <compilation>  
    <assemblies>
        <add assembly="System.Web.WebPages.Razor, Version=1.0.0.0,Culture=neutral,PublicKeyToken=31BF3856AD364E35" />
    </assemblies>
    <buildProviders>
        <add extension=".cshtml" type="System.Web.WebPages.Razor.RazorBuildProvider, System.Web.WebPages.Razor, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
    </buildProviders>
    </compilation>
 </system.web>
A.H.
  • 63,967
  • 15
  • 92
  • 126
tfn
  • 11
  • 1