I am getting an error like the following while publishing a project with Visual Studio:
Copying file Areas\AdminPanel\Content\assets\global\plugins\bootstrap-editable\inputs-ext\wysihtml5\bootstrap-wysihtml5-0.0.2\bootstrap-wysihtml5-0.0.2.css to 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 failed. The specified path, file name, or both are too long. The fully qualified file name must be less than 260 characters, and the directory name must be less than 248 characters.
Is there a simple way to solve this problem or should I make the path shorter?
I am working with ASP.NET Web Forms btw.
That is a Windows limitation. You can disable it this way:
Navigate to "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\FileSystem"
Find a value named LongPathsEnabled
and double-click it. If you don’t see the value listed, you’ll need to create it by right-clicking the FileSystem key, choosing New > DWORD (32-bit) Value, and then naming the new value LongPathsEnabled
Change the value from 0 to 1 in the “Value data” box and then click OK.
After that, you would probably have to restart visual studio.
Windows has a limitation that can be configured. See NicoRiff's answer.
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
I suggest you, to create a folder in the root of your disc, for example D:/Dev
where all your projectes are stored.
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.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With