Running TextTransform.exe (T4) on a build server

夙愿已清 提交于 2019-12-05 04:14:10

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

Ethan J. Brown

Ditch the Microsoft TextTransform.exe and use the free one that ships with MonoDevelop that doesn't have external dependencies.

See here: T4 without Visual Studio?

  1. Copy the following directory from your development machine to the build server.

    Source (your machine):

    %CommonProgramFiles(x86)%\Microsoft Shared\TextTemplating\<version>.0

    Destination (build server):

    %CommonProgramFiles(x86)%\Microsoft Shared\TextTemplating\<version>.0

    Where <version> is the most recent version.

  2. Copy all assemblies (.dll) from your development machine to the build server.

    Source (your machine): %WinDir%\Microsoft.NET\assembly\GAC_MSIL\Microsoft.VisualStudio.TextTemplating.*

    Destination (build server):

    %CommonProgramFiles(x86)%\Microsoft Shared\TextTemplating\<version>.0

    Where * is the rest of the directory name.

  3. Using Gacutil /i install all copied assemblies into GAC of the build server.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!