MSBUILD:错误MSB1009:项目文件不存在
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了MSBUILD:错误MSB1009:项目文件不存在相关的知识,希望对你有一定的参考价值。
我正在尝试使用TFS为我的ASP.NET网站(网站项目)实现CI(持续集成)。几天来我一直在跟踪错误。以下是完整的日志。它根本没有获得最新版本到本地目录,这就是它给出错误的原因.... MSBUILD:错误MSB1009:项目文件不存在。我已经检查过TFS没有获得最新版本,我不知道为什么...... !!!!
任何帮助真的很感激,谢谢你提前。
2018-02-26T22:18:13.2365258Z ##[section]Starting: Build
2018-02-26T22:18:13.2385315Z Current agent version: '2.117.2'
2018-02-26T22:18:13.5846688Z ##[section]Starting: Initialize Job
2018-02-26T22:18:13.5926727Z Prepare build directory.
2018-02-26T22:18:13.6386956Z Set build variables.
2018-02-26T22:18:13.6457073Z Download all required tasks.
2018-02-26T22:18:13.6878173Z ##[section]Finishing: Initialize Job
2018-02-26T22:18:13.7139315Z ##[section]Starting: Get Sources
2018-02-26T22:18:13.7831194Z Prepending Path environment variable with
directory containing 'tf.exe'.
2018-02-26T22:18:13.7841199Z Querying workspace information.
2018-02-26T22:18:14.8803708Z ##[command]tf vc workspace /delete
ws_3_398;91fe1581-91d7-4cee-bb0c-81e67ca0f83a
/collection:https://tfs.ups.com/tfs/UpsProd/ /loginType:OAuth
/login:.,******** /noprompt
2018-02-26T22:18:18.9914765Z ##[command]tf vc workspace /new /location:local
/permission:Public ws_3_398 /collection:https://tfs.ups.com/tfs/UpsProd/
/loginType:OAuth /login:.,******** /noprompt
2018-02-26T22:18:20.8991396Z ##[command]tf vc workfold /unmap
/workspace:ws_3_398 $/ /collection:https://tfs.ups.com/tfs/UpsProd/
/loginType:OAuth /login:.,******** /noprompt
2018-02-26T22:18:21.9989171Z ##[command]tf vc workfold /map
/workspace:ws_3_398 "$/P04C/CRMSA_ESTAT_ESP_SRC/Tools/ESP Website"
"D:UAMCAgent\_work3sESP Website"
/collection:https://tfs.ups.com/tfs/UpsProd/ /loginType:OAuth
/login:.,******** /noprompt
2018-02-26T22:18:22.7551176Z ##[command]tf vc get /version:2028385
/recursive /overwrite D:UAMCAgent\_work3s /loginType:OAuth
/login:.,******** /noprompt
2018-02-26T22:18:23.6383909Z All files are up to date.
2018-02-26T22:18:23.6615759Z ##[section]Finishing: Get Sources
2018-02-26T22:18:23.6636095Z ##[section]Starting: Build solution
2018-02-26T22:18:23.6716308Z
2018-02-26T22:18:23.6716308Z Task : Visual Studio Build
2018-02-26T22:18:23.6716308Z Description : Build with MSBuild and set the
Visual Studio version property
2018-02-26T22:18:23.6716308Z Version : 1.119.0
2018-02-26T22:18:23.6716308Z Author : Microsoft Corporation
2018-02-26T22:18:23.6716308Z Help : [More Information]
(https://go.microsoft.com/fwlink/?LinkID=613727)
2018-02-26T22:18:23.6716308Z
2018-02-26T22:18:26.0666962Z ##
[command]"D:UAMCAgent\_work\_tasksVSBuild_71a9a2d3-a98a-4caa-96ab-
affca411ecda1.119.0ps_modulesMSBuildHelpersvswhere.exe" -version
[15.0,16.0)
-latest -format json
2018-02-26T22:18:26.3567330Z ##[command]"C:Program Files (x86)Microsoft Visual
Studio2017ProfessionalMSBuild15.0Binamd64msbuild.exe"
"D:UAMCAgent\_work3sESP WebsiteESP_WEB.sln" /nologo /nr:false
/dl:CentralLogger,"D:UAMCAgent\_work\_tasksVSBuild_71a9a2d3-a98a-4caa-
96ab-
tedTask.MSBuild.Logger.dll";"RootDetailId=0ff9d26a-993f-4bb6-a05a-
582b3d0d7a52|SolutionDir=D:UAMCAgent\_work3sESP
Website"*ForwardingLogger,"D:UAMCAgent\_work\_tasksVSBuild_71a9a2d3-a98a-
4caa-96ab-
tedTask.MSBuild.Logger.dll" /p:DeployOnBuild=true
/p:WebPublishMethod=Package
/p:PackageAsSingleFile=true /p:SkipInvalidConfigurations=true
/p:PackageLocation="D:UAMCAgent\_work3a" /p:platform="any cpu"
/p:configuration="release" /p:VisualStudioVersion="15.0"
/p:_MSDeployUserAgent="TFS_b14eb634-1b27-4e21-8f9e-
13237b04eab7_build_831_73513"
2018-02-26T22:18:26.4365554Z MSBUILD : error MSB1009: Project file does not
exist.
2018-02-26T22:18:26.4365554Z Switch: D:UAMCAgent\_work3sESP
WebsiteESP_WEB.sln
2018-02-26T22:18:26.5830048Z ##[error]Process 'msbuild.exe' exited with code
'1'.
2018-02-26T22:18:26.6361526Z ##[section]Finishing: Build solution
2018-02-26T22:18:26.6381598Z ##[section]Starting: Post Job Cleanup
2018-02-26T22:18:26.6451749Z ##[section]Finishing: Post Job Cleanup
2018-02-26T22:18:26.6501892Z ##[section]Finishing: Build
根据您的日志和描述,似乎TFS get命令(Get Source Step)错误地返回“所有文件都是最新的。”并导致后面的MSBuild步骤失败。
首先尝试按照以下步骤检查它是否在get source期间通过set clean工作:
- 修改你的定义:在Repository中设置Clean to True,Clean to Sources选项(如果不起作用,尝试设置Source Directory)
- 还为构建解决方案任务启用“清除”选项
另一种可能性是未映射根源文件夹(D:UAMCAgent\_work3s
) - 即工作空间不包含根映射。
并建议您仔细检查相关的构建帐户权限,并在构建代理上授予其本地管理员权限。
您可以在构建定义中禁用默认的get source步骤。并使用您自己的脚本来获取源/拉文件,看看您是否得到相同的情况。怎么样,请关注:Is it able to ignore/disable the first step Get source in vNext Build?
以上是关于MSBUILD:错误MSB1009:项目文件不存在的主要内容,如果未能解决你的问题,请参考以下文章
cmake cmake MSBUILD : error MSB1009: 项目文件不存在 or MSBuild.exe not find !
cmake cmake MSBUILD : error MSB1009: 项目文件不存在 or MSBuild.exe not find !
“错误 MSB1009:项目文件不存在。”使用竹子部署 asp.net 项目时