1

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?

4

2 に答える 2

2

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.

于 2010-07-12T01:21:35.557 に答える
1

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.

于 2009-06-18T19:18:51.557 に答える