views:

325

answers:

4

We are writing an app that will use T4 to generate Flex/Actionscript to compile into SWF. We would like to distribute this app to users who will not have VS. I've searched and searched and could not find any info anywhere on redistributing microsoft.visualstudio.texttemplating.dll with your apps, except on this code plex project (http://customtemplating.codeplex.com/) that allows hosting your own T4 builder (which uses and does include a copy of microsoft.visualstudio.texttemplating.dll).

So, does anyone know for sure or could tell me where I can find info on including this dll in our app?

Thank you in advance! Ilya

+1  A: 

I'm pretty sure it's not allowed. If Microsoft allows a package to be redistributed they include a redist.txt with it or put it in a redist folder.

ZippyV
A: 

In VS2010 they've moved the dependencies that T4 relies on to an external class. Can you use a Beta of VS2010 to create the dependencies?

Preet Sangha
+2  A: 

I emailed Tim Cools of the Custom Templating project on CodePlex and he emailed MS rep from this thread (http://social.msdn.microsoft.com/Forums/en-US/vsx/thread/1ab0bf3f-2810-4adf-bf75-900b98dee8e2) with the same question. Here's the response:

"If a user has VS2008 or higher installed, he'll have the dll installed. There is no redistributable. If he's on VS2005 then he'll need to install the DSL run time redistributable, because it's not included in the VS2005 box. But that does require him to have VS2005 installed as well (as clearly stated in thread you refer to).

So the short answer is that all users must have VS installed to use this DLL."

Tim later goes on to say "But actually there is a redistributable which contains the dll : Microsoft Visual Studio 2008 Shell (integrated mode) Redistributable Package [link removed - new user limit] But it is way too big (315.9 MB) in comparison wit the dll (84 kb)."

With this I agree.

The final answer, however, seems to lie in T4 for VS 2010 Beta, as discussed here: [link removed - new user limit]

"[T]here are already some new features for T4 in Beta1 of VS 2010, notably the ability to have a preprocessed template that compiles down to code with no dependency on the T4 runtime. You can learn a bit more about his on my blog at [link removed - new user limit] and [link removed - new user limit]"

So, this is what we're probably going to go with. Preprocess the templates so that they do not have any dependencies. I just wanted to share with everyone what I found.

Ilya
+2  A: 

I wrote a cleanly reverse-engineered implementation of a T4 engine for the MonoDevelop IDE. It's open-source, licensed under the permissive MIT/X11 license, so you are free to embed the engine in your app or redistribute it. There's also an implementation of the TextTransform.exe command-line tool, and some APIs in the Mono.TextTemplating namespace to aid in hosting the engine.

The only real missing feature right now is custom directive providers - but patches for this are welcome :-)

You can get the code from monodevelop/main/src/addins/TextTemplating in Mono SVN.

mhutch
Thank you for pointing that out, Michael. I saw a mention of TextTemplating in Mono online but not having worked with Mono before had trouble locating the library. We ended up going with Spark View Engine (http://sparkviewengine.com/) which will server our needs perfectly, but it's nice to know there's an alternative similar to T4.
Ilya