我似乎有点混淆了我的项目,每当一个门控构建和签入运行,我会得到以下错误……
Summary
| Phase 1
15 error(s), 602 warning(s)
Phase 1 - 15 error(s), 602 warning(s)
CSC:CSC(0,0): Error CS2001: Source file 'd:\a\3\s\Main\SmartEndPointAssessment\SA.SEPA.Web.UI.Selenium\Features\AssessmentCentreEpaFeatures.feature.cs' could not be found.
CSC:CSC(0,0): Error CS2001: Source file 'd:\a\3\s\Main\SmartEndPointAssessment\SA.SEPA.Web.UI.Selenium\Features\AssessmentCentreFeatures.feature.cs' could not be found.
CSC:CSC(0,0): Error CS2001: Source file 'd:\a\3\s\Main\SmartEndPointAssessment\SA.SEPA.Web.UI.Selenium\Features\AssessorEpaFeatures.feature.cs' could not be found.
CSC:CSC(0,0): Error CS2001: Source file 'd:\a\3\s\Main\SmartEndPointAssessment\SA.SEPA.Web.UI.Selenium\Features\AssessorFeatures.feature.cs' could not be found.
CSC:CSC(0,0): Error CS2001: Source file 'd:\a\3\s\Main\SmartEndPointAssessment\SA.SEPA.Web.UI.Selenium\Features\ClientSettingsFeatures.feature.cs' could not be found.
CSC:CSC(0,0): Error CS2001: Source file 'd:\a\3\s\Main\SmartEndPointAssessment\SA.SEPA.Web.UI.Selenium\Features\CustomFieldFeatures.feature.cs' could not be found.
CSC:CSC(0,0): Error CS2001: Source file 'd:\a\3\s\Main\SmartEndPointAssessment\SA.SEPA.Web.UI.Selenium\Features\EmployerFeatures.feature.cs' could not be found.
CSC:CSC(0,0): Error CS2001: Source file 'd:\a\3\s\Main\SmartEndPointAssessment\SA.SEPA.Web.UI.Selenium\Features\LoginFeatures.feature.cs' could not be found.
CSC:CSC(0,0): Error CS2001: Source file 'd:\a\3\s\Main\SmartEndPointAssessment\SA.SEPA.Web.UI.Selenium\Features\MyProfileFeatures.feature.cs' could not be found.
CSC:CSC(0,0): Error CS2001: Source file 'd:\a\3\s\Main\SmartEndPointAssessment\SA.SEPA.Web.UI.Selenium\Features\ReportFeatures.feature.cs' could not be found.
CSC:CSC(0,0): Error CS2001: Source file 'd:\a\3\s\Main\SmartEndPointAssessment\SA.SEPA.Web.UI.Selenium\Features\SettingsFeatures.feature.cs' could not be found.所有这些文件都存在于我的本地路径中,并且我的解决方案构建并运行。当我试图签入时,我得到了上面的错误。
查看源代码管理中的代码,文件不存在。此外,在解决方案资源管理器中,这些文件在它们旁边没有'+‘图标。

这是VSTS的文件夹..。

如何获得源代码管理来识别和添加这些文件?
谢谢,
发布于 2017-11-28 08:27:08
根据你的截图和文件已经签入的TFS源代码控制。担心当前出现的错误的根本原因是TFVC限制,
对于单个文件夹或文件名,不能包含超过259个Unicode字符。 来源链接:https://learn.microsoft.com/en-us/vsts/collaborate/naming-restrictions#version-control-paths
您必须在TFS源代码管理中手动调整文件/文件夹结构以避免此问题。从C:\Agent\_work\1\s\TestCaseProject到C:\Agent\_work\1\s\TestCasePro
通过减少名称和/或容器文件夹的长度或减少文件夹嵌套级别,减少这些文件的完整路径长度。因此,减小了整个路径长度。
您也可以看看这个类似的问题:升级到Visual 2012之后,在链接文件中找不到MSBuild错误"CSC : error CS2001:源文件'x‘“
https://stackoverflow.com/questions/47517416
复制相似问题