volkovku / RazorTemplates

Open source templating engine based on Microsoft's Razor parsing engine. Thread safe. Allows run Razor templates outside ASP.Net MVC Projects.
Microsoft Public License
99 stars 32 forks source link

Template.Compile fails #11

Open SiccoOne opened 10 years ago

SiccoOne commented 10 years ago

Hello,

I have problem with Template.Compile() method.

My template looks like:

That compilation works in Console Application and in one my test Windows Service, but fails in another Windows Service. (but e.g. simple template like: @Model.Name works)

The generated source code is the same, but in Windows service I get TemplateCompilationException with many errors ( "} expected", "Type expected", "Invalid token...", etc).

Is possible that I'm missing some dependencies or is there some conflict with other references?

netcore-jroger commented 7 years ago

not use foreach. you can use forto do .