Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Publishing project with files with very long names

I am trying to publish a project in Visual Studio 2013 that has some files with very long names, including the path location. I moved the project to a location closer to my root C:\ drive, which allows it to compile, but when publishing, it tries to copy files to the %appdata% folder which results in a name over the limit.

Here is the error I get:

Error   10  Copying file node_modules\grunt-bower\node_modules\bower\node_modules\bower-registry-client\node_modules\bower-config\node_modules\optimist\node_modules\minimist\.travis.yml to C:\Users\jake\AppData\Local\Temp\WebSitePublish\WebProject--1320288221\obj\Debug\Package\PackageTmp\node_modules\grunt-bower\node_modules\bower\node_modules\bower-registry-client\node_modules\bower-config\node_modules\optimist\node_modules\minimist\.travis.yml 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.     0   0   WebProject

Is there a way to either adjust this project's name or where it copies to temporarily so that I am able to publish from Visual Studio?

like image 350
Jake Avatar asked Apr 02 '15 19:04

Jake


1 Answers

Citing @Britton from Temp path too long when publishing a web site project:

Add this to your publish profile to modify the temporary directory for package/publish:

<AspnetCompileMergeIntermediateOutputPath>c:\shortPath\</AspnetCompileMergeIntermediateOutputPath>

Or according to Website publish failing due to file path being too long (citing @Jason Beck and @VeeKayBee):

Add the following line in default PropertyGroup of web project file:

<IntermediateOutputPath>..\Temp</IntermediateOutputPath>
like image 166
Amnon Shochot Avatar answered Sep 28 '22 00:09

Amnon Shochot