我的项目似乎有点混乱,每当门控构建和签入运行时,我都会收到以下错误......
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 中的文件夹...
如何让源代码管理识别并添加这些文件?
Thanks,
根据您的屏幕截图和已在 TFS 源代码管理中签入的文件。恐怕您所遇到的错误的根本原因目前是 TFVC 限制,来自
Must not contain more than 259 Unicode characters for a single folder or file name.
来源链接:版本控制路径 https://learn.microsoft.com/en-us/vsts/collaborate/naming-restrictions#version-control-paths
你必须手动调整你的文件/文件夹结构在 TFS 源代码管理中绕过此问题。从C:\Agent\_work\1\s\TestCaseProject
to C:\Agent\_work\1\s\TestCasePro
通过减少名称长度和/或容器文件夹的长度或减少文件夹嵌套级别来减少这些文件的完整路径长度。因此减少了全路径长度。
您也可以看看这个类似的问题:升级到 Visual Studio 2012 后,链接文件出现 MSBuild 错误“CSC:错误 CS2001:无法找到源文件 'x'” https://stackoverflow.com/questions/16746337/msbuild-error-csc-error-cs2001-source-file-x-could-not-be-found-with-link
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)