TextTemplating Transformation failing with Win32Exception (0x80004005)

Sean Murphy 1 Reputation point
2022-11-11T17:19:55.933+00:00

I'm trying to set up my development environment on a new laptop and I'm suddenly having a problem I've never had before. A text transform using TextTemplating in a migrations project is failing, and the error message doesn't give me much to go off of. All of the files referenced exist and are in the right place, and I've made sure their permissions aren't restricting anything. This looks like it could be a PATH issue, but according to the build log all of the MSBuildTools paths look correct. This is using the latest VS2019 version.

Transforming template Build\BuildInfo.tt... (TaskId:9)  
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\MSBuild\Microsoft\VisualStudio\v16.0\TextTemplating\Microsoft.TextTemplating.targets(340,5): error : Running transformation: System.ComponentModel.Win32Exception (0x80004005): The system cannot find the file specified  
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\MSBuild\Microsoft\VisualStudio\v16.0\TextTemplating\Microsoft.TextTemplating.targets(340,5): error :    at System.Diagnostics.Process.StartWithCreateProcess(ProcessStartInfo startInfo)  
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\MSBuild\Microsoft\VisualStudio\v16.0\TextTemplating\Microsoft.TextTemplating.targets(340,5): error :    at System.Diagnostics.Process.Start()  
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\MSBuild\Microsoft\VisualStudio\v16.0\TextTemplating\Microsoft.TextTemplating.targets(340,5): error :    at Microsoft.VisualStudio.TextTemplating4C374DA128B1CEA46F8BA186E7EDE4CD053056490F410C038921D190887F9C8F86A20E1161C6E22B7B6DADD779D82E7778373F47CBC859DE99B2DD9DD80DCEED.GeneratedTextTransformation.TransformText(). Line=0, Column=0  
Developer technologies | Visual Studio | Other
Community Center | Not monitored
{count} votes

1 answer

Sort by: Most helpful
  1. Sean Murphy 1 Reputation point
    2024-01-05T14:43:48.0966667+00:00

    If you are building the project while signed in with an admin account, make sure that your admin account has git.exe in its PATH variable. The basic visual studio git does not get added to the path, you are best off just downloading and installing the git stand alone installer. If you don't do this, you will get TextTemplating/TextTransform errors if one of the .tt files (they are scripts) tries to call git.exe.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.