1

I am trying to use TFS build to run a batch file 'tt.bat', it's a very sample batch file it just creates a folder. mkdir d:\ttt The batch file is working correctly but when i build it with VS 2013 i got error here's the log:

Compile, Test and Publish00:00:06

Run optional script before MSBuild00:00:00
Run MSBuild00:00:01
C:\Program Files\Microsoft Team Foundation Server 12.0\Tools\nuget.exe restore "C:\Builds\1\Test2\CIB2\src\Solution1.sln" -NonInteractive
C:\Program Files (x86)\MSBuild\12.0\bin\amd64\MSBuild.exe /nologo /noconsolelogger "C:\Builds\1\Test2\CIB2\src\Solution1.sln" /nr:False /fl /flp:"logfile=C:\Builds\1\Test2\CIB2\src\Solution1.log;encoding=Unicode;verbosity=normal" /p:SkipInvalidConfigurations=true /m /p:OutDir="C:\Builds\1\Test2\CIB2\bin\\" /p:VCBuildOverride="C:\Builds\1\Test2\CIB2\src\Solution1.sln.vsprops" /dl:WorkflowCentralLogger,"C:\Program Files\Microsoft Team Foundation Server 12.0\Tools\Microsoft.TeamFoundation.Build.Server.Logger.dll";"Verbosity=Normal;BuildUri=vstfs:///Build/Build/36;InformationNodeId=12;TargetsNotLogged=GetNativeManifest,GetCopyToOutputDirectoryItems,GetTargetPath;TFSUrl=http://localhost:8080/tfs/DefaultCollection;"*WorkflowForwardingLogger,"C:\Program Files\Microsoft Team Foundation Server 12.0\Tools\Microsoft.TeamFoundation.Build.Server.Logger.dll";"Verbosity=Normal;" /p:BuildId="6da97dfb-9620-440e-9dcc-c177a2e0ab90,vstfs:///Build/Build/36" /p:BuildLabel="CIB2_20151104.2" /p:BuildTimestamp="Wed, 04 Nov 2015 08:47:52 GMT" /p:BuildSourceVersion="LCIB2_20151104.2@$/Test2" /p:BuildDefinition="CIB2"


Run optional script after MSBuild00:00:05
C:\Builds\1\Test2\CIB2\src\tt.bat
C:\Builds\1\Test2\CIB2\src>mkdir d:\ttt
The device is not ready.
 Exception Message: TF270015: 'tt.bat' returned an unexpected exit code. Expected '0'; actual '1'. See the build logs for more details. (type UnexpectedExitCodeException) Exception Stack Trace: at System.Activities.Statements.Throw.Execute(CodeActivityContext context) at System.Activities.CodeActivity.InternalExecute(ActivityInstance instance, ActivityExecutor executor, BookmarkManager bookmarkManager) at System.Activities.Runtime.ActivityExecutor.ExecuteActivityWorkItem.ExecuteBody(ActivityExecutor executor, BookmarkManager bookmarkManager, Location resultLocation)

Here's my build definition: Build Definiation

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.