【发布时间】:2018-07-22 03:06:45
【问题描述】:
我们有一个 Pre-Build 事件,它应该检查我们的 AssemblyInfo.cs 文件,以便下一个 Pre-Build 事件可以转换我们的 AssemblyInfo.tt T4 模板并生成一个新的 AssemblyInfo.cs 文件 - 这是我们的程序集版本控制解决方案。
但是,预构建事件命令“突然”开始失败 - 它们之前工作正常,查看源代码控制历史记录,没有人更改命令。
我已取出文本转换命令以消除潜在问题。
现在唯一的预构建事件是:
"$(VS100COMNTOOLS)..\IDE\TF.exe" checkout "$(ProjectDir)Properties\AssemblyInfo.cs"
我已经打开了构建的“诊断”级别输出,这就是它所说的:
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)
我意识到它说“系统找不到指定的路径”,但我检查了路径,它是正确的。
我什至尝试过像这样在 VS 开发者命令提示符中直接运行 TF.exe 命令:
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"
这就成功了。
谁能看到可能导致 Pre-Build 事件失败的原因?
【问题讨论】:
标签: visual-studio-2017 pre-build-event