VS 2012 - Checkout on Pre-Build does not occur

The pre-build script event starts by checking the file and then modifying this file by running another tool. But the tool does not update my file because the check does not occur / completed. Why?

Here is an example of my script:

tf checkout $(ProjectDir)MyFileToCheckout.cs mytool.exe /argument:MyFileToCheckout.cs 

At the moment, I need to manually check the file in Visual Studio, and then build.

+4
source share
2 answers

The problem is that tf.exe is not in the path to the window, and when the visual studio tries to run command windows, it does not know where to look for it.

so that..

A) Change your path to include the path to tf.exe (it is in the folder with visual studio)
B) Modify the build command to include the full path to tf.exe

 "C:\program files (x86)\microsoft visual studio 11.0\Common7\IDE\tf.exe" checkout $(ProjectDir)MyFileToCheckout.cs 
+4
source

"$ (DevEnvDir) tf" is the solution I was looking for - it’s actually just another way to solve the same problem.

It is simple and general. Desirable, I think.

I think this is also more suitable for teams, and it does not need to be changed if the project is upgraded to another version of VS.

0
source

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


All Articles