We have a Pre-Build event which is supposed to check-out our AssemblyInfo.cs file, so that the next Pre-Build event can transform our AssemblyInfo.tt T4 Template and generate a new AssemblyInfo.cs file - this is our assembly versioning solution.
However, the pre-build event commands started failing 'all of a sudden' - they were previously working fine and looking at source control history, no one has changed the commands.
I've taken out the text transform command to eliminate the potential issues.
The only pre-build event there now is:
"$(VS100COMNTOOLS)..\IDE\TF.exe" checkout "$(ProjectDir)Properties\AssemblyInfo.cs"
I have turned on 'Diagnostic' level output from the build, and this is what it says:
1> Task Parameter:Command="..\IDE\TF.exe" checkout "C:\_dev\CCM\Development\SAPN.CCM\SAPN.CCM.Service.Core\Properties\AssemblyInfo.cs"
1> (TaskId:18)
1> "..\IDE\TF.exe" checkout "C:\_dev\CCM\Development\SAPN.CCM\SAPN.CCM.Service.Core\Properties\AssemblyInfo.cs"
1> (TaskId:18)
1> The system cannot find the path specified. (TaskId:18)
1>C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\15.0\Bin\Microsoft.Common.CurrentVersion.targets(1274,5): error MSB3073: The command ""..\IDE\TF.exe" checkout "C:\_dev\CCM\Development\SAPN.CCM\SAPN.CCM.Service.Core\Properties\AssemblyInfo.cs"
1>C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\15.0\Bin\Microsoft.Common.CurrentVersion.targets(1274,5): error MSB3073: " exited with code 3.
1>Done executing task "Exec" -- FAILED. (TaskId:18)
1>Done building target "PreBuildEvent" in project "SAPN.CCM.Service.Core.csproj" -- FAILED.: (TargetId:20)
I realise it says "The system cannot find the path specified" but I've checked the path and it is correct.
I have even tried running the TF.exe command directly in the VS Developer Command Prompt like this:
C:\Program Files (x86)\Microsoft Visual Studio\2017\Community>TF.exe checkout "C
:\_dev\CCM\Branches\CCA-Service-NoERTinSettings\SAPN.CCM\SAPN.CCM.Service\Proper
ties\AssemblyInfo.cs"
And that succeeds.
Can anyone see what might be causing the Pre-Build event to fail?