Question

I am building a product, and I need a way to generate code at the runtime. Currently, I use VB.Net (only for this and nothing else) xml literals (is that what they are called?), to create templates and create code at runtime. My question is, can I use T4 on web server in shared hosting, without VS installed, to generated code at runtime?

Was it helpful?

Solution

I know this question is old, but now the answer is outdated so I thought I'd chime in. If you're using Visual Studio 2010's new preprocessed templates, you can now do this. Instead of using T4 to generate code at compile time, you use T4 to generate a generator class, and that generator class can be used at run-time. This means that T4 can be used to generate any string output, not just something you need compiled into your project - and that makes it a real replacement for tools like NVelocity.

OTHER TIPS

Maybe the answers to this question will help you out. T4 without Visual Studio?

However, T4 is a build-time (or design-time) tool, not a run-time tool, so it doesn't seem like the best solution for what you're trying to do.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top