繁体   English   中英

尝试在 Visual Studio (2019) 中发布时复制文件失败

[英]Failed to copy file when trying to publish in Visual Studio (2019)

我正在尝试根据Microsoft 自己的指南发布 C# 项目,但是当我尝试这样做时遇到以下错误(当构建 output 日志级别设置为诊断时)。

Error: Failed to copy file '[path that is over 260 characters]' to '[path that is under 260 characters]'.
Unable to add '[path that is under 260 characters]' to the Web site.
Unable to add file '[subset of path that is under 260 characters]'.
The system cannot find the path specified.

我已经抽象了文字路径以使错误更易于阅读。

这里发生了什么?

启用 Windows 长路径(超过 260 个字符的路径)并重新启动不会将您保存在这里。

如果您遇到此问题,那么一种解决方案是移动您的项目,使其尝试复制的路径长度不超过 260 个字符。 基本上把你的项目移到尽可能靠近驱动器根的地方。

那里可能有更好的解决方案,但是我一直无法找到一种方法来通知 Microsoft 的发布工具以正确解释超过 260 的路径。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM