msbuild error: The property DirectoryName does not exist or was not found

msbuild error: The property DirectoryName does not exist or was not found

这是我第一次尝试在 Visual Studio 在线配置自动构建。

创建新版本后,我将其排队到 运行。第一步已成功完成(获取源代码)。现在我在构建步骤中遇到错误。这是一个包含消息的小片段:

782 2015-08-31T16:30:52.4324803Z Executing the powershell script: C:\LR\MMS\Services\Mms\TaskAgentProvisioner\Tools\tasks\VSBuild.0.13\VSBuild.ps1

783 2015-08-31T16:30:54.0509690Z ##[error]The property DirectoryName does not exist or was not found.

784 2015-08-31T16:30:54.1321607Z C:\Program Files (x86)\MSBuild.0\bin\msbuild.exe "C:\abc0b6a3\MySolution" /nologo /m /nr:false /fl /flp:"logfile=C:\abc0b6a3\MySolution.log" /dl:CentralLogger,"C:\LR\MMS\Services\Mms\TaskAgentProvisioner\Tools\agent\worker\Microsoft.TeamFoundation.DistributedTask.MSBuild.Logger.dll"*ForwardingLogger,"C:\LR\MMS\Services\Mms\TaskAgentProvisioner\Tools\agent\worker\Microsoft.TeamFoundation.DistributedTask.MSBuild.Logger.dll" /p:platform="any cpu" /p:configuration="debug" /p:VisualStudioVersion="14.0"

785 2015-08-31T16:30:54.2859104Z MSBUILD : error MSB1009: Project file does not exist.

我在整个解决方案中搜索了 DirectoryName 字符串但没有成功,现在知道它是什么意思了。

编译在我的 PC 上工作正常,我不知道从哪里开始看。

有什么想法吗?

你错过了真正的错误:

785 2015-08-31T16:30:54.2859104Z MSBUILD : error MSB1009: Project file does not exist.

您需要指定解决方案文件的路径。你可以看到你不是:

C:\Program Files (x86)\MSBuild.0\bin\msbuild.exe "C:\abc0b6a3\MySolution" /nologo /m /nr:false /fl /flp:"logfile=C:\abc0b6a3\MySolution.log" /dl:CentralLogger,"C:\LR\MMS\Services\Mms\TaskAgentProvisioner\Tools\agent\worker\Microsoft.TeamFoundation.DistributedTask.MSBuild.Logger.dll"*ForwardingLogger,"C:\LR\MMS\Services\Mms\TaskAgentProvisioner\Tools\agent\worker\Microsoft.TeamFoundation.DistributedTask.MSBuild.Logger.dll" /p:platform="any cpu" /p:configuration="debug" /p:VisualStudioVersion="14.0"

您只需为 "Solutions" 参数指定 **\*.sln,它将发现并构建您映射的工作区中的所有解决方案。如果你需要更具体的,你也可以这样做。

解决方案文件所在的文件夹应位于 'Repository' 选项卡下映射中定义的路径之一或以下,否则也会出现 'Project file does not exist' 错误。