ASP.NET发布错误(指定的路径,文件名或两者都太长) [英] ASP.NET Publish Error (The specified path, file name, or both are too long)

查看:156
本文介绍了ASP.NET发布错误(指定的路径,文件名或两者都太长)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

使用Visual Studio发布项目时出现以下错误:

I am getting an error like the following while publishing a project with Visual Studio:

将文件Areas \ AdminPanel \ Content \ assets \ global \ plugins \ bootstrap-editable \ inputs-ext \ wysihtml5 \ bootstrap-wysihtml5-0.0.2 \ bootstrap-wysihtml5-0.0.2.css复制到obj \Release \ Package \ PackageTmp \ Areas \ AdminPanel \ Content \ assets \ global \ plugins \ bootstrap-editable \ inputs-ext \ wysihtml5 \ bootstrap-wysihtml5-0.0.2 \ bootstrap-wysihtml5-0.0.2.css失败.指定的路径,文件名或两者都太长.完全限定的文件名必须少于260个字符,目录名称必须少于248个字符.

是否有解决此问题的简单方法,还是应该缩短路径?

Is there a simple way to solve this problem or should I make the path shorter?

我正在使用ASP.NET Web窗体.

I am working with ASP.NET Web Forms btw.

推荐答案

Windows具有可以配置的限制.参见 NicoRiff的答案.

Windows has a limitation that can be configured. See NicoRiff's answer.

那蜜蜂说,下面的字符串只有" 173个字符长:

That beeing said, the following string is "only" 173 chars long:

obj\Release\Package\PackageTmp\Areas\AdminPanel\Content\assets\global\plugins\bootstrap-editable\inputs-ext\wysihtml5\bootstrap-wysihtml5-0.0.2\bootstrap-wysihtml5-0.0.2.css

我建议您在光盘根目录中创建一个文件夹,例如 D:/Dev ,用于存储所有项目.

I suggest you, to create a folder in the root of your disc, for example D:/Dev where all your projectes are stored.

更改注册表也是一种选择,但是需要为每个开发人员进行配置,这是次优的.通常,您应该走更短的路.Checkout和Build应该是座右铭.

Changing the registry would also be an option, but needs to be configured for every developer, which is suboptimal. Generaly you should go for shorter paths. Checkout and Build should be the motto.

在发布软件时,您还应该缩小/打包您的客户端脚本.这样,您在发布的输出中只有一个短路径 bundle.css .

When you ship the software you should also minify/bundle your client side scripts. This way you only have one short path bundle.css in your published output.

这篇关于ASP.NET发布错误(指定的路径,文件名或两者都太长)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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