【问题标题】:'CSC:CSC(0,0): Error CS2001: Source file [file] could not be found.' when running a gated check in (C#)'CSC:CSC(0,0): 错误 CS2001: 找不到源文件 [file]。'运行门控签入时(C#)
【发布时间】:2018-05-11 01:47:09
【问题描述】:

我的项目似乎有点混乱,每当一个封闭的构建和签入运行时,我都会收到以下错误.....

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 中的 src 文件?如果是这样,请进行比较,看看您在版本构建方面缺少什么您是否有团队负责人可以帮助您尽快解决此问题..?
  • 它们似乎是解决方案的一部分,但不受源代码控制。您是否尝试过右键单击并添加到源代码管理?

标签: c# visual-studio tfs azure-devops


【解决方案1】:

根据您的屏幕截图和已在 TFS 源代码管理中签入的文件。恐怕您目前得到的错误的根本原因是 TFVC 限制,来自

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

来源链接:Version control paths

您必须在 TFS 源代码控制中手动调整文件/文件夹结构才能绕过此问题。从C:\Agent\_work\1\s\TestCaseProjectC:\Agent\_work\1\s\TestCasePro

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

你也可以看看这个类似的问题:MSBuild error "CSC : error CS2001: Source File 'x' could not be found" with Linked Files after upgrading to Visual Studio 2012

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2023-03-08
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2013-05-20
    • 2012-01-31
    • 2013-09-16
    相关资源
    最近更新 更多