构建服务器上运行TextTransform.exe(T4) [英] Running TextTransform.exe (T4) on a build server

查看:370
本文介绍了构建服务器上运行TextTransform.exe(T4)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图安装一个过程,我的T4模板将生成服务器上进行改造(Visual Studio中未安装有)。

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.

具体而言,这里的2个问题我遇到:

Specifically, here's the 2 issues i've encountered:


  • TextTransform.exe抛出约缺少DLL的错误:

C:\TeamCity\buildAgent\work\AppSettings.tt(0,0):错误CS0006:
编译转型:元数据文件
'Microsoft.VisualStudio.TextTemplating。 Interfaces.10.0,
版本= 10.0.0.0,文化=中性公钥= b03f5f7f11d50a3a'
找不到

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

使用注册DLL文件的 GACUTIL 的修复了这个问题,但我想避免这个步骤。

Registering the DLL files using gacutil fixes this issue, although i would like to avoid this step.


  • 使用的 Host.ResolvePath(串)的方法不返回时的Visual Studio之外被运行的任何价值。

  • Using the Host.ResolvePath(string) method does not return any value when being run outside of Visual Studio.

此方法有助于在确定所使用的模板作为数据源的.txt文件的完整路径。没有它,这个文件不能在构建服务器上找到。

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.

编辑:打开一个MS CONNECT问题:的 https://connect.microsoft.com/VisualStudio/feedback/details/744137/texttransform-exe-does-not-work-without-vs2010-installed

opened an MS CONNECT issue: https://connect.microsoft.com/VisualStudio/feedback/details/744137/texttransform-exe-does-not-work-without-vs2010-installed

引用我已经检查:

  • Get Visual Studio to run a T4 Template on every build
  • T4 without Visual Studio?
  • http://msdn.microsoft.com/en-us/library/ee847423.aspx#buildserver

推荐答案

我相信这个问题是您正在使用的主机特定的功能,例如与resolvePath。

I believe the issue is that you are using host specific features such ResolvePath.

一个办法我想尝试的是确保模板不使用与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

如果你不喜欢强迫开发者设置环境变量,我会考虑,如果可用的使用环境变量智能与resolvePath的想法,否则依靠Host.ResolvePath。

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.

希望这有助于

这篇关于构建服务器上运行TextTransform.exe(T4)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆