'CSC:CSC(0,0):错误CS2001:找不到源文件[file].'在运行门禁签入(C#)时 [英] 'CSC:CSC(0,0): Error CS2001: Source file [file] could not be found.' when running a gated check in (C#)

查看:349
本文介绍了'CSC:CSC(0,0):错误CS2001:找不到源文件[file].'在运行门禁签入(C#)时的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的项目似乎有些混乱,每当进行封闭式构建和检入运行时,都会出现以下错误.....

I appear to have got in a bit of a mixup with my project and whenever a gated build and check in runs, I get the following errors.....

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.

所有这些文件都存在于我的本地路径中,并且我的解决方案得以构建并运行.当我尝试签入时,出现上述错误.

All these files exist in my local path, and my solution builds and runs. Its when I try to check in I get the errors above.

查看源代码管理中的代码,文件不存在.此外,在解决方案资源管理器中,这些文件旁边没有"+"图标.

Looking at the code in source control, the files don't exist. Also these files don't have the '+' icon next to them in solution explorer.

这是VSTS中的文件夹...

This is the folder in VSTS...

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

How do I get source control to recognize and add these files?

谢谢

推荐答案

根据您的屏幕快照以及TFS源代码管理中已检查的文件.

According to your screenshoot and the file already checked in TFS source control. Afraid the root cause of the error you got in short currently its the TFVC limitation, from

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

You have to manually tweak your file/folder structure in TFS source control to bypass this issue. From C:\Agent\_work\1\s\TestCaseProject to C:\Agent\_work\1\s\TestCasePro

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

Reduce the full path length of those files, by reducing the length of the name and/or the length of the container folder or reducing the folder nesting level. Therefore reducing the full path length.

您也可以看看这个类似的问题:

You could also take a look at this similar question: MSBuild error "CSC : error CS2001: Source File 'x' could not be found" with Linked Files after upgrading to Visual Studio 2012

这篇关于'CSC:CSC(0,0):错误CS2001:找不到源文件[file].'在运行门禁签入(C#)时的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆