TFS Hosted Build Controller - Microsoft.TextTemplating.targets not found

I am debugging a problem during the day and cannot understand it. Perhaps someone else came across something similar and could shed some light?

We configured all the T4 templates in the project in our solution for launching when the project is built, as in shift-ctrl-b. This works great - we needed to add this import statement to the .csproj project file:

<Import Project="$(MSBuildExtensionsPath)\Microsoft\VisualStudio\v10.0\TextTemplating\Microsoft.TextTemplating.targets"/> 

We have established continuous integration through Visual Studio 2012 and cloud TFS (tfs.visualstudio.com). When our solution is built on a hosted TFS controller, we continue to receive the following error:

The imported project "C: \ Program Files \ MSBuild \ Microsoft \ VisualStudio \ v10.0 \ TextTemplating \ Microsoft.TextTemplating.targets" could not be found. Verify that the path in the declaration is correct and that the file exists on disk.

On our machines, a dev file exists, and therefore the problem is that the file does not exist on the hosted assembly server.

If we correct this assumption, is there a workaround to this problem besides installing our own TFS build server?

+6
source share
3 answers

I doubt that hosted assembly servers have Visual Studio 2010 (v10.0).

You can get a list of what is currently installed on the servers of the hosted assembly here , Tarun Arora has more detailed information here .

For your problem, try option 11.0 (for VS2012):

 <Import Project="$(MSBuildExtensionsPath) \Microsoft\VisualStudio\v11.0\TextTemplating\Microsoft.TextTemplating.targets"/> 

A better approach would be to use the VisualStudioVersion MSBuild property:

 <Import Project="$(MSBuildExtensionsPath) \Microsoft\VisualStudio\v$(VisualStudioVersion)\TextTemplating\Microsoft.TextTemplating.targets"/> 

This ensures that future hosted build server updates do not affect your code. Read here for more details.

+4
source

Perhaps some files are missing. :) So, I was in the same situation. Here is the solution.

The right solution is to install

Microsoft Visual Studio 2010 Visualization and Modeling SDK http://www.microsoft.com/en-us/download/confirmation.aspx?id=23025

Creates a folder

C: \ Program Files (x86) \ MSBuild \ Microsoft \ VisualStudio \ v10.0 \ TextTemplating and Microsoft.TextTemplating.targets and others

Microsoft Visual Studio 2012 Visualization and Modeling SDK http://www.microsoft.com/en-us/download/confirmation.aspx?id=30680

Creates a folder

C: \ Program Files (x86) \ MSBuild \ Microsoft \ VisualStudio \ v11.0 \ TextTemplating and Microsoft.TextTemplating.targets and others

Enjoy!;)

PS Somehow the Microsoft Visual Studio 2010 Visualization and Modeling SDK creates a folder here

C: \ Program Files (X86) \ MSBuild \ Microsoft \ VisualStudio \ TextTemplating \ v10.0

+1
source

The Microsoft.TextTemplating.targets file comes with overhead that you probably don't need (SDK modeling for Microsoft Visual Studio). You will most likely get away with a simple NuGet package that will be converted during assembly (using TextTransform.exe): Clarius.TransformOnBuild .

For more information, see the blog post article.

0
source

Source: https://habr.com/ru/post/952129/


All Articles