I have to create a bunch of static html files as console / winform job. The current solution uses a string builder. Having used ASP.NET-MVC with strongly typed view pages (System.Web.Mvc.ViewPage) I was wondering if it is possible to leverage these view pages and have them output to a stream or file without building an ASP.NET solution.
Essentially I'd like to create the viewpage, pass in the strongly typed object, and render the result.
I'm also open to other view engines.
If this ends up requiring bringing over the whole kitchen sink, then I can just do a string builder style.
Thanks.
What you need is a templating engine. I would recommend you StringTemplate. It can be used as standalone engine and it has a .NET version. There's a CodeProject article that could get you started.
AFAIK ASP.NET WebForms cannot run without the ASP.NET infrastructure.