I am trying to setup a process where my T4 templates will be transformed on the build server (Visual Studio is not installed there).
I've read all online references, but could not get a clear source that shows how to do this.
Specifically, here's the 2 issues i've encountered:
C:\TeamCity\buildAgent\work\AppSettings.tt(0,0) : error CS0006: Compiling transformation: Metadata file 'Microsoft.VisualStudio.TextTemplating.Interfaces.10.0, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' could not be found
Registering the DLL files using gacutil fixes this issue, although i would like to avoid this step.
This method helps in determining a full path to the .txt file that is used by the template as its data source. Without it this file can not be found on the build server.
Any help will be appreciated in getting this running.
EDIT: opened an MS CONNECT issue: https://connect.microsoft.com/VisualStudio/feedback/details/744137/texttransform-exe-does-not-work-without-vs2010-installed
References i have checked:
TextTransform.exe is a command-line tool that you can use to transform a text template. When you call TextTransform.exe, you specify the name of a text template file as an argument. TextTransform.exe calls the text transformation engine and processes the text template.
I believe the issue is that you are using host specific features such ResolvePath.
One way I would try is making sure the templates doesn't use ResolvePath but instead rely on relative paths from a well-known location.
This well-known location could be known by:
1. Convention
2. Environment variable
3. Registry
4. SQL Server
5. Web Service
6. And others
If you don't like the idea of forcing devs setup environment variables I would consider making a "smart" resolvepath that uses the environment variable if available, otherwise relies on Host.ResolvePath.
Hope this helps
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With