I’m using the ASP.NET 4.0 compiler to pre-compile my ASP.NET MVC 3 project, and I’m using Razor as part of an email template engine.
The problem is that the compiler is trying to compile my views (GOOD) as well as my templates (BAD). Can I configure it to prevent the templates from being compiled?
The views are located in ~/Views while the templates are located in ~/Templates. Each directory has their own separate Web.config.
Precompilation by defintion compiles the entire site so there’s no way to disable that. If you are using a non-BuildProvider-based method of instantiating the email templates (i.e. you call some other API directly to compile them when necessary) then you could try to change the file extension of your templates so that those files are not recognized by the ASP.NET BuildProvider.