‘CSC:CSC(0,0):错误CS2001:找不到源文件。 在进行门控检查时(C#)

我似乎与我的项目有点混淆,每当一个门控构建和签入运行时,我得到以下错误…..

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中的文件夹…

在此处输入图像描述

如何获取源代码控制以识别和添加这些文件?

谢谢,

根据您的屏幕截图和已在TFS源代码管理中检查的文件。 你最后得到的错误的根本原因是它的TFVC限制

 Must not contain more than 259 Unicode characters for a single folder or file name. 

源链接: 版本控制路径

您必须手动调整 TFS源代码管理中的文件/文件夹结构以绕过此问题。 从C:\Agent\_work\1\s\TestCaseProjectC:\Agent\_work\1\s\TestCasePro

通过减少容器文件夹的名称长度和/或长度或减少文件夹嵌套级别来减少这些文件的完整路径长度。 因此减少了完整的路径长度。

你也可以看看这个类似的问题: 升级到Visual Studio 2012后,MSBuild错误“CSC:错误CS2001:源文件’x’无法找到”链接文件