I need to send emails from a Windows Service and came across ActionMailer.net, a templated email system that can be used either within an ASP.Net MVC application or stand-alone.
Following the stand-alone tutorial
http://geeksharp.com/2011/07/06/actionmailer-0-6-released/
I'm at the point where I'm creating a View. However, when I type any text into the view it's underlined with a blue squiggle. Mousing over the blue squiggle reveals an error message in a tool tip:
There is no build provider registered for the extension '.cshtml' You can register one in the
<compilation><buildProviders>
section of machine.config or web.config
Seems I'm missing a step setting up Razor support.
What am I missing?
That's just a warning. Your project will compile and work perfectly fine when you run it. Now in order to get tooling support for your Razor templates outside of an ASP.NET MVC application you may take a look at the following blog post.
So to cheat the Visual Studio's (stupid) Intellisense simply drop a web.config (yeah web.config) in the root of your Windows Service project with the following contents:
At runtime it's absolutely unnecessary and has no effect of course (your application was working before as well). It's just to trick VS into thinking that this is a web application and provide you with Intellisense.
Add the following code block in the root web.config file under system.web section: