I have created a build definition on TFS 2013 and inside the process tab of build definition there are 5 sections for Build process parameter
- TF Version Control
- Build
- Test
- Publish Symbols
- Advanced
Inside the Build section there are 5 sub section
- Projects
- Configurations
- Clean build
- Output location
- Advanced.
Inside Advanced section there is an option of “pre-build script arguments” & “prebuild script path”.
Inside the “prebuild script path” I have provide the path of a batch file.
This batch file calls an exe file which is available at the same location. In batch file I have written below lines
start "My Project" MyProject.exe
MyProject.exe is a console application with below codes
string[] lines = { "First line", "Second line", "Third line" };
string fileName2 = DateTime.Now.ToLongDateString().Replace("//","_").Replace(",","_") + DateTime.Now.ToLongTimeString().Replace(":", "_").Replace(" ","") + ".txt";
System.IO.File.WriteAllLines(fileName2, lines);
Now I am running this TFS build application then it is taking too much time at pre-build event. It was running for last 50 minutes then I stopped it.
Before adding batch script build process was working fine.
Now my question is that how can I make sure that whatever I have written in batch script is running successfully and exe file is writing a *.txt file so where can I check that file?
I have gone through these links
Post build event in VS2012..Running a Batch file
Problem Executing Batch File in Pre-Build Event
But they are talking that their build is failing but in my case build is not failing rather that that it is taking too long time.
Sorry if this question is irrelevant or I am doing some mistake. I am new to TFS build integration and not much aware about all those processes.