gpt4 book ai didi

c# - 文件名 'file' 太长或无效 Visual Studio 2010 和 2012

转载 作者:行者123 更新时间:2023-11-30 16:16:22 25 4
gpt4 key购买 nike

我在尝试构建 .Net 3.5 类库时发现了一个有趣的错误,我在 visual studio 2012 中遇到了这个错误。

Error   201 File name '..\..\..\..\B2B.Common\Documentation\
FooBarBaz.Core.Providers.ScheduledTaskProviders
.foobarbazSearchAlerting.XML'
is too long or invalid D:\FooBarBaz\5000\5000 - xyz - xyxy - example -
IRE\B2B.Common\Src\FooBarBaz.Core.Providers
.ScheduledTaskProviders\foobarbaz Search Alerting\CSC
foobarbaz Search Alerting

问题是,我可以毫无问题地在 VS2010 中构建它。

根据 MSDN当带有路径的文件名超过 260 个字符时显示此错误。实际上是 156。

所以两个问题是:

为什么这适用于 VS2010 而不是 2012?

我如何在 VS2012 中解决这个问题?

最佳答案

这是一个已知问题。文件名不能无限长。您需要重新设计命名约定。坦率地说,名字,FooBarBaz.Portfolio.Core.Providers.ScheduledTaskProviders.foobarbazSearchAlerting.XML 是计算的受虐狂。

为避免这种情况,我将我的源代码控制分支映射到简单的 c:\DEV\Branch_Name。

您肯定需要与您的团队讨论这个问题并重新设计您的命名和文件夹模式。我会说,文件的部分名称不应超过 3 个。 公司.产品.业务

请看这个博客。 http://visualstudio.uservoice.com/forums/121579-visual-studio/suggestions/2156195-fix-260-character-file-name-length-limitation

这可能对你有帮助

关于c# - 文件名 'file' 太长或无效 Visual Studio 2010 和 2012,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18490353/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com