Questo sembra essere un problema comune e ho trovato diverse domande Stack Overflow, ma sembrano tutte relative a MSBuild."Percorso troppo lungo" durante la pubblicazione di asp.net 5 da Visual Studio 2015
Sto tentando di pubblicare facendo clic con il pulsante destro del mouse sul mio progetto asp.net 5 rc1 in Visual Studio e richiamando un profilo di pubblicazione basato su file system.
Le sue impostazioni simile a questa:
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<WebPublishMethod>FileSystem</WebPublishMethod>
<LastUsedBuildConfiguration>Release</LastUsedBuildConfiguration>
<LastUsedPlatform>Any CPU</LastUsedPlatform>
<SiteUrlToLaunchAfterPublish />
<LaunchSiteAfterPublish>True</LaunchSiteAfterPublish>
<ExcludeApp_Data>False</ExcludeApp_Data>
<CompileSource>False</CompileSource>
<_DefaultDNXVersion>dnx-clr-win-x86.1.0.0-rc1-final</_DefaultDNXVersion>
<UsePowerShell>True</UsePowerShell>
<IISCommand>web</IISCommand>
<WebRoot>wwwroot</WebRoot>
<WwwRootOut>wwwroot</WwwRootOut>
<IncludeSymbols>False</IncludeSymbols>
<Native>False</Native>
<IgnoreDNXRuntime>False</IgnoreDNXRuntime>
<publishUrl>C:\Source\CCollections\artifacts\bin\CCollections.Client.Web.Angular\Release\PublishOutput</publishUrl>
<DeleteExistingFiles>False</DeleteExistingFiles>
</PropertyGroup>
</Project>
Questo produce questo output:
C:\Source\CCollections\src\CCollections.Client.Web.Angular>C:\Users\Christopher\.dnx\runtimes\dnx-clr-win-x86.1.0.0-rc1-final\bin\dnu.cmd publish "C:\Source\CCollections\src\CCollections.Client.Web.Angular" --out "C:\Users\Christopher\AppData\Local\Temp\PublishTemp\CCollections.Client.Web.Angular96" --configuration Release --runtime dnx-clr-win-x86.1.0.0-rc1-final --wwwroot "wwwroot" --wwwroot-out "wwwroot" --iis-command "web" Microsoft .NET Development Utility Clr-x86-1.0.0-rc1-16202 Executing script 'prepublish' in project.json npm WARN package.json [email protected] No description npm WARN package.json [email protected] No repository field. npm WARN package.json [email protected] No README data npm WARN package.json [email protected] No license field. npm WARN unmet dependency C:\Source\CCollections\src\CCollections.Client.Web.Angular\node_modules\gulp-cssmin\node_modules\gulp-util requires [email protected]'^0.2.0' but will load npm WARN unmet dependency C:\Source\CCollections\src\CCollections.Client.Web.Angular\node_modules\gulp-cssmin\node_modules\minimist, npm WARN unmet dependency which is version 1.1.1 npm WARN unmet dependency C:\Source\CCollections\src\CCollections.Client.Web.Angular\node_modules\gulp-cssmin\node_modules\through2 requires [email protected]'~1.0.17' but will load npm WARN unmet dependency C:\Source\CCollections\src\CCollections.Client.Web.Angular\node_modules\gulp-cssmin\node_modules\readable-stream, npm WARN unmet dependency which is version 1.1.13 [12:15:37] Using gulpfile C:\Source\CCollections\src\CCollections.Client.Web.Angular\gulpfile.js [12:15:37] Starting 'clean:js'... [12:15:37] Starting 'clean:css'... [12:15:37] Finished 'clean:js' after 8.17 ms [12:15:37] Finished 'clean:css' after 7.58 ms [12:15:37] Starting 'clean'... [12:15:37] Finished 'clean' after 6.63 μs [12:15:38] Using gulpfile C:\Source\CCollections\src\CCollections.Client.Web.Angular\gulpfile.js [12:15:38] Starting 'min:js'... [12:15:38] Finished 'min:js' after 14 ms [12:15:38] Starting 'min:css'... [12:15:38] Finished 'min:css' after 3.02 ms [12:15:38] Starting 'min'... [12:15:38] Finished 'min' after 6.03 μs [12:15:40] Using gulpfile C:\Source\CCollections\src\CCollections.Client.Web.Angular\gulpfile.js [12:15:40] Starting 'libcopy'... [12:15:40] Finished 'libcopy' after 19 ms Copying to output path C:\Users\Christopher\AppData\Local\Temp\PublishTemp\CCollections.Client.Web.Angular96 Using Package dependency Microsoft.AspNet.DataProtection.Abstractions 1.0.0-rc1-final Using Package dependency Microsoft.CodeAnalysis.CSharp 1.1.0-rc1-20151109-01 Using Package dependency Microsoft.AspNet.Identity 3.0.0-rc1-final Using Package dependency Microsoft.Extensions.Configuration.CommandLine 1.0.0-rc1-final Using Package dependency Microsoft.Extensions.Logging.Console 1.0.0-rc1-final Using Package dependency System.Runtime.InteropServices 4.0.0 Using Package dependency System.Diagnostics.Debug 4.0.0 Using Package dependency Microsoft.AspNet.Mvc.Razor.Host 6.0.0-rc1-final Source C:\Users\Christopher\.dnx\packages\Microsoft.AspNet.Mvc.Razor.Host\6.0.0-rc1-final Target C:\Users\Christopher\AppData\Local\Temp\PublishTemp\CCollections.Client.Web.Angular96\approot\packages\Microsoft.AspNet.Mvc.Razor.Host\6.0.0-rc1-final Source C:\Users\Christopher\.dnx\packages\System.Runtime.InteropServices\4.0.0 Using Package dependency EntityFramework.Commands 7.0.0-rc1-final Source C:\Users\Christopher\.dnx\packages\EntityFramework.Commands\7.0.0-rc1-final Target C:\Users\Christopher\AppData\Local\Temp\PublishTemp\CCollections.Client.Web.Angular96\approot\packages\EntityFramework.Commands\7.0.0-rc1-final Source C:\Users\Christopher\.dnx\packages\Microsoft.CodeAnalysis.CSharp\1.1.0-rc1-20151109-01 Source C:\Users\Christopher\.dnx\packages\Microsoft.Extensions.Configuration.CommandLine\1.0.0-rc1-final Target C:\Users\Christopher\AppData\Local\Temp\PublishTemp\CCollections.Client.Web.Angular96\approot\packages\Microsoft.Extensions.Configuration.CommandLine\1.0.0-rc1-final Source C:\Users\Christopher\.dnx\packages\Microsoft.AspNet.DataProtection.Abstractions\1.0.0-rc1-final Target C:\Users\Christopher\AppData\Local\Temp\PublishTemp\CCollections.Client.Web.Angular96\approot\packages\Microsoft.AspNet.DataProtection.Abstractions\1.0.0-rc1-final Source C:\Users\Christopher\.dnx\packages\System.Diagnostics.Debug\4.0.0 Target C:\Users\Christopher\AppData\Local\Temp\PublishTemp\CCollections.Client.Web.Angular96\approot\packages\System.Diagnostics.Debug\4.0.0 Using Package dependency Microsoft.AspNet.Mvc.TagHelpers 6.0.0-rc1-final Source C:\Users\Christopher\.dnx\packages\Microsoft.AspNet.Mvc.TagHelpers\6.0.0-rc1-final Target C:\Users\Christopher\AppData\Local\Temp\PublishTemp\CCollections.Client.Web.Angular96\approot\packages\Microsoft.AspNet.Mvc.TagHelpers\6.0.0-rc1-final Target C:\Users\Christopher\AppData\Local\Temp\PublishTemp\CCollections.Client.Web.Angular96\approot\packages\Microsoft.CodeAnalysis.CSharp\1.1.0-rc1-20151109-01 Target C:\Users\Christopher\AppData\Local\Temp\PublishTemp\CCollections.Client.Web.Angular96\approot\packages\System.Runtime.InteropServices\4.0.0 Using Package dependency Microsoft.Extensions.Configuration.EnvironmentVariables 1.0.0-rc1-final Source C:\Users\Christopher\.dnx\packages\Microsoft.Extensions.Configuration.EnvironmentVariables\1.0.0-rc1-final Source C:\Users\Christopher\.dnx\packages\Microsoft.Extensions.Logging.Console\1.0.0-rc1-final Source C:\Users\Christopher\.dnx\packages\Microsoft.AspNet.Identity\3.0.0-rc1-final Target C:\Users\Christopher\AppData\Local\Temp\PublishTemp\CCollections.Client.Web.Angular96\approot\packages\Microsoft.AspNet.Identity\3.0.0-rc1-final Target C:\Users\Christopher\AppData\Local\Temp\PublishTemp\CCollections.Client.Web.Angular96\approot\packages\Microsoft.Extensions.Configuration.EnvironmentVariables\1.0.0-rc1-final Using Package dependency Microsoft.AspNet.Diagnostics 1.0.0-rc1-final Source C:\Users\Christopher\.dnx\packages\Microsoft.AspNet.Diagnostics\1.0.0-rc1-final Target C:\Users\Christopher\AppData\Local\Temp\PublishTemp\CCollections.Client.Web.Angular96\approot\packages\Microsoft.AspNet.Diagnostics\1.0.0-rc1-final Using Package dependency EntityFramework.Core 7.0.0-rc1-final Using Package dependency Microsoft.AspNet.Mvc.ViewFeatures 6.0.0-rc1-final Source C:\Users\Christopher\.dnx\packages\Microsoft.AspNet.Mvc.ViewFeatures\6.0.0-rc1-final Target C:\Users\Christopher\AppData\Local\Temp\PublishTemp\CCollections.Client.Web.Angular96\approot\packages\Microsoft.AspNet.Mvc.ViewFeatures\6.0.0-rc1-final Target C:\Users\Christopher\AppData\Local\Temp\PublishTemp\CCollections.Client.Web.Angular96\approot\packages\Microsoft.Extensions.Logging.Console\1.0.0-rc1-final Using Package dependency Microsoft.Dnx.Compilation.Abstractions 1.0.0-rc1-final Using Package dependency Microsoft.Extensions.Configuration.FileExtensions 1.0.0-rc1-final Source C:\Users\Christopher\.dnx\packages\Microsoft.Extensions.Configuration.FileExtensions\1.0.0-rc1-final Target C:\Users\Christopher\AppData\Local\Temp\PublishTemp\CCollections.Client.Web.Angular96\approot\packages\Microsoft.Extensions.Configuration.FileExtensions\1.0.0-rc1-final Using Package dependency Microsoft.AspNet.Identity.EntityFramework 3.0.0-rc1-final Source C:\Users\Christopher\.dnx\packages\Microsoft.AspNet.Identity.EntityFramework\3.0.0-rc1-final Source C:\Users\Christopher\.dnx\packages\EntityFramework.Core\7.0.0-rc1-final Target C:\Users\Christopher\AppData\Local\Temp\PublishTemp\CCollections.Client.Web.Angular96\approot\packages\EntityFramework.Core\7.0.0-rc1-final Using Package dependency System.Diagnostics.DiagnosticSource 4.0.0-beta-23516 Using Package dependency Microsoft.Extensions.Logging.Debug 1.0.0-rc1-final Source C:\Users\Christopher\.dnx\packages\Microsoft.Extensions.Logging.Debug\1.0.0-rc1-final Target C:\Users\Christopher\AppData\Local\Temp\PublishTemp\CCollections.Client.Web.Angular96\approot\packages\Microsoft.Extensions.Logging.Debug\1.0.0-rc1-final Using Package dependency Microsoft.AspNet.Diagnostics.Abstractions 1.0.0-rc1-final Source C:\Users\Christopher\.dnx\packages\Microsoft.AspNet.Diagnostics.Abstractions\1.0.0-rc1-final Using Package dependency Microsoft.AspNet.PageExecutionInstrumentation.Interfaces 1.0.0-rc1-final Source C:\Users\Christopher\.dnx\packages\Microsoft.AspNet.PageExecutionInstrumentation.Interfaces\1.0.0-rc1-final Target C:\Users\Christopher\AppData\Local\Temp\PublishTemp\CCollections.Client.Web.Angular96\approot\packages\Microsoft.AspNet.PageExecutionInstrumentation.Interfaces\1.0.0-rc1-final Using Package dependency Microsoft.Extensions.Configuration.FileProviderExtensions 1.0.0-rc1-final Source C:\Users\Christopher\.dnx\packages\Microsoft.Dnx.Compilation.Abstractions\1.0.0-rc1-final Target C:\Users\Christopher\AppData\Local\Temp\PublishTemp\CCollections.Client.Web.Angular96\approot\packages\Microsoft.Dnx.Compilation.Abstractions\1.0.0-rc1-final Target C:\Users\Christopher\AppData\Local\Temp\PublishTemp\CCollections.Client.Web.Angular96\approot\packages\Microsoft.AspNet.Identity.EntityFramework\3.0.0-rc1-final Target C:\Users\Christopher\AppData\Local\Temp\PublishTemp\CCollections.Client.Web.Angular96\approot\packages\Microsoft.AspNet.Diagnostics.Abstractions\1.0.0-rc1-final Using Package dependency System.Text.Encoding 4.0.0 Source C:\Users\Christopher\.dnx\packages\System.Text.Encoding\4.0.0 Target C:\Users\Christopher\AppData\Local\Temp\PublishTemp\CCollections.Client.Web.Angular96\approot\packages\System.Text.Encoding\4.0.0 Source C:\Users\Christopher\.dnx\packages\System.Diagnostics.DiagnosticSource\4.0.0-beta-23516 Target C:\Users\Christopher\AppData\Local\Temp\PublishTemp\CCollections.Client.Web.Angular96\approot\packages\System.Diagnostics.DiagnosticSource\4.0.0-beta-23516 Source C:\Users\Christopher\.dnx\packages\Microsoft.Extensions.Configuration.FileProviderExtensions\1.0.0-rc1-final Target C:\Users\Christopher\AppData\Local\Temp\PublishTemp\CCollections.Client.Web.Angular96\approot\packages\Microsoft.Extensions.Configuration.FileProviderExtensions\1.0.0-rc1-final Error: 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. Error: 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. C:\Source\CCollections\src\CCollections.Client.Web.Angular>
Penso che il mio problema è qui: C:\Users\Christopher\AppData\Local\Temp\PublishTemp\CCollections.Client.Web.Angular96\
ho bisogno di utilizzare un percorso più breve, come C: \ Temp.
Ho provato alcuni dei suggerimenti in altre risposte di overflow dello stack.
L'aggiunta di <AspnetCompileMergeIntermediateOutputPath>c:\shortPath\</AspnetCompileMergeIntermediateOutputPath>
al profilo non sembra essere d'aiuto.
L'aggiunta di <IntermediateOutputPath>..\Temp</IntermediateOutputPath>
non sembra funzionare.
Immagino sia perché queste impostazioni vengono rilevate da MSBuild, ma non da dnu publish.
Così come faccio a dire a dnu publish di compilare il pacchetto in C: \ Temp invece della mia directory appdata?
Aggiornamento: individuazione dei colpevoli: penso che i file che superano il limite di percorso non si trovino nel registro precedente e che vengano registrate solo le copie riuscite. Per verificare questa ipotesi:
- ho schierato a c: \ temp eseguendo DNU pubblicare manualmente
- copiato i file da C: \ Temp di C: \ Users \ Christopher \ AppData \ Local \ Temp \ PublishTemp
Eseguire uno script per ripetere tutti i file in modo ricorsivo e generare lunghezze del percorso superiori a 248 caratteri. Risultati:
C: \ Users \ Christopher \ AppData \ Local \ Temp \ PublishTemp \ CCollections.Client.Web.Angular96 \ approot \ packages \ Microsoft.Extensions.Configuration.FileProviderExtensions \ 1.0.0-rc1-final \ lib \ net451 \ Microsoft.Extensions.Configuration.FileProviderExtensions.dll
percorso di file lunghi: 249 caratteri
C: \ Users \ Christopher \ AppData \ Local \ Temp \ PublishTemp \ CCollections.Client.Web.Angular96 \ AppRoot \ packages \ Microsoft.Extensions.Configuration.FileProviderExtensions \ 1.0.0-rc1-final \ lib \ netcore50 \ Microsoft.Extensions.Configuration.FileProviderExtensions.dll
percorso di file lunghi: 252 caratteri
La cartella più grande è 191 caratteri, e con il file è 252 caratteri, in modo che non è superiore a 240 e 260 caratteri, rispettivamente.
A prescindere da tutto ciò, come posso dire a Visual Studio 2015 di utilizzare "C: \ temp" come directory temporanea, invece della directory temporanea del mio profilo?
In quale fase della pubblicazione avviene questo? Succede quando vengono installati i pacchetti del nodo? – Dealdiane
Se guardo il percorso 'C: \ Users \ Christopher \ AppData \ Local \ Temp \ PublishTemp \ CCollections.Client.Web.Angular96' con Explorer durante l'esecuzione di' dnu publish', vedo cartelle come 'Microsoft.AspNet .PageExecutionInstrumentation.Interfaces' che compare in approot/packages immediatamente prima che riceva l'errore. – Chris
Potresti postare l'output della tua pubblicazione dnu? Inoltre, puoi cambiare l'output con 'dnu publish -o'. –
Dealdiane