目标" TransformAll"在项目中的T4变换的MSBuild不存在 [英] The target "TransformAll" does not exist in the project T4 transformation MSBuild

查看:442
本文介绍了目标" TransformAll"在项目中的T4变换的MSBuild不存在的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想用改造我的T4模板的的MSBuild ,所以我发现<一href="http://www.olegsych.com/2010/04/understanding-t4-msbuild-integration/#CallingMSBuildExplicitly"相对=nofollow>这个链接。但是运行的时候:

  

的MSBuild solution.sln /吨:TransformAll

我得到的目标TransformAll以下错误并不在项目中存在的。

如果我尝试编译一个项目同样的情况。不管,如果我打开VS工具控制台或常规控制台,并得到了MSBuild的路径。

我在想什么?

以下是我得到的输出(我affraid它在西班牙语......抱歉,我不能做任何事情):

  C:\ IDB-的Git \ IDB.All&GT;的MSBuild IDB.All-Main.sln /吨:TransformAll / P:配置=调试/号码:平台=任何
中央处理器
微软(R)生成引擎版本12.0.31101.0
[Microsoft .NET Framework的版本4.0.30319.34209]
版权所有(C)微软公司。待办事项洛杉矶derechos reservados。

洛杉矶PROYECTOS日ESTAsolución本身面包车compilar德UNO EN乌诺。帕拉habilitar拉compilación连接杆
alelo,agregue报modificador/ M。
Compilacióniniciada一个拉斯维加斯2015年11月5日下午四点37分44秒。
PROYECTOC:\ IDB-的Git \ IDB.All \ IDB.All-Main.sln恩报NODO 1(TransformAll destinos)。
ValidateSolutionConfiguration:
  Compilando拉configuración日SOLUCIONES调试|任何CPU。
ValidateProjects:
  萨尔瓦多PROYECTO美洲开发银行。presentation.Tests没有本质seleccionó对拉compilación恩拉configuración德小号
  oluciones调试|任何CPU。
C:\ IDB-的Git \ IDB.All \ IDB.All-Main.sln.metaproj:错误MSB4057:厄尔尼诺DESTINOTransformAll没有existeê
ñ埃尔PROYECTO。 [C:\ IDB-的Git \ IDB.All \ IDB.All-Main.sln]
Compilación德尔PROYECTO terminadaC:\ IDB-的Git \ IDB.All \ IDB.All-Main.sln(TransformAll destinos) - 
 错误。


ERROR人compilar。

C:\ IDB-的Git \ IDB.All \ IDB.All-Main.sln(TransformAll DESTINO)(1) - &GT;
  C:\ IDB-的Git \ IDB.All \ IDB.All-Main.sln.metaproj:错误MSB4057:厄尔尼诺DESTINOTransformAll没有existe
 恩报PROYECTO。 [C:\ IDB-的Git \ IDB.All \ IDB.All-Main.sln]

    0 Advertencia(S)
    1 Errores

时代报transcurrido 00:00:00.15
 

解决方案

您不必导入到项目文件中的Microsoft.TextTemplating.targets。这个目标文件提供了TransformAll目标。如果没有此导入这个目标不存在,因此MSBuild的会,如果你尝试调用这个目标误差。

如果你指的是包括在C中的目标文件中的文件:\程序文件(x86)\的MSBuild \微软\ VisualStudio中\ 12.0 \ TextTemplating \ Microsoft.TextTemplating.targets(Visual Studio的2013路),它详细介绍了如何在项目中包含这个指标。

  

使用这个目标文件

     
     

要使用此目标文件:

     

1)导入该目标文件到您的项目中加入   适当&LT;进口...&GT;   例如&LT;进口   Project="$(MSBuildExtensionsPath)\Microsoft\VisualStudio\v$(VisualStudioVersion)\TextTemplating\Microsoft.TextTemplating.targets"   /&GT;

     

这import语句必须包含的的标准VB / C#   目标导入,因为它自身附加到$(BuildDependsOn)   属性。

I want to transform my T4 templates using MSBuild, so I found this link. But when running:

msbuild solution.sln /t:TransformAll

I get the following error "The target "TransformAll" does not exist in the project".

The same happens if I try to compile a single project. No matter if I open a VS tools console or a regular console and get the MSBuild path.

What am I missing?

The following is the output I get (I'm affraid that it is in spanish... sorry but I cannot do anything about that):

C:\IDB-Git\IDB.All>msbuild IDB.All-Main.sln /t:TransformAll /p:Configuration=Debug /p:Platform="Any
CPU"
Microsoft (R) Build Engine, versión 12.0.31101.0
[Microsoft .NET Framework, versión 4.0.30319.34209]
Copyright (C) Microsoft Corporation. Todos los derechos reservados.

Los proyectos de esta solución se van a compilar de uno en uno. Para habilitar la compilación en par
alelo, agregue el modificador "/m".
Compilación iniciada a las 11/05/2015 04:37:44 p.m..
Proyecto "C:\IDB-Git\IDB.All\IDB.All-Main.sln" en el nodo 1 (TransformAll destinos).
ValidateSolutionConfiguration:
  Compilando la configuración de soluciones "Debug|Any CPU".
ValidateProjects:
  El proyecto"IDB.Presentation.Tests" no se seleccionó para la compilación en la configuración de s
  oluciones "Debug|Any CPU".
C:\IDB-Git\IDB.All\IDB.All-Main.sln.metaproj : error MSB4057: El destino "TransformAll" no existe e
n el proyecto. [C:\IDB-Git\IDB.All\IDB.All-Main.sln]
Compilación del proyecto terminada "C:\IDB-Git\IDB.All\IDB.All-Main.sln" (TransformAll destinos) --
 ERROR.


ERROR al compilar.

"C:\IDB-Git\IDB.All\IDB.All-Main.sln" (TransformAll destino) (1) ->
  C:\IDB-Git\IDB.All\IDB.All-Main.sln.metaproj : error MSB4057: El destino "TransformAll" no existe
 en el proyecto. [C:\IDB-Git\IDB.All\IDB.All-Main.sln]

    0 Advertencia(s)
    1 Errores

Tiempo transcurrido 00:00:00.15

解决方案

You do not have the Microsoft.TextTemplating.targets imported into your project file. This targets file provides the TransformAll target. Without this import this target does not exist and so MSBuild will error if you try to invoke this target.

If you refer to the documentation which is included in the target file at C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v12.0\TextTemplating\Microsoft.TextTemplating.targets (Visual Studio 2013 path) it details how to include this target in your project.

Using this targets file


To use this targets file:

1) Import this targets file into your project by adding the appropriate <Import ...> e.g. <Import Project="$(MSBuildExtensionsPath)\Microsoft\VisualStudio\v$(VisualStudioVersion)\TextTemplating\Microsoft.TextTemplating.targets" />

This import statement must be included after the standard VB/C# targets import, as it appends itself to the $(BuildDependsOn) property.

这篇关于目标&QUOT; TransformAll&QUOT;在项目中的T4变换的MSBuild不存在的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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