Open
Description
This was reported as https://developercommunity.visualstudio.com/content/problem/312243/the-updatemanifest-task-failed-unexpectedly.html.
Steps to reproduce
Call the UpdateManifest
task with a path for ApplicationManifest
that is longer than MAX_PATH
(possibly even only before collapsing ..
path elements).
msbuild UpdateManifest_LongPaths.proj
Expected behavior
Successful build (that's probably blocked by #53) or a clear error.
Actual behavior
Microsoft (R) Build Engine version 15.9.14-preview+gae560092f5 for .NET Framework
Copyright (C) Microsoft Corporation. All rights reserved.
Build started 9/27/2018 10:47:10 AM.
Project "s:\repro\UpdateManifest_LongPaths\UpdateManifest_LongPaths.proj" on node 1 (default targets).
s:\repro\UpdateManifest_LongPaths\UpdateManifest_LongPaths.proj(3,3): error MSB4018: The "UpdateManifest" task failed unexpectedly.
s:\repro\UpdateManifest_LongPaths\UpdateManifest_LongPaths.proj(3,3): error MSB4018: System.NullReferenceException: Object reference not set to an instance of an object.
s:\repro\UpdateManifest_LongPaths\UpdateManifest_LongPaths.proj(3,3): error MSB4018: at Microsoft.Build.Tasks.Deployment.ManifestUtilities.Manifest.UpdateEntryPoint(String inputPath, String outputPath, String updatedApplicationPath, String applicationManifestPath, String targetFrameworkVersion)
s:\repro\UpdateManifest_LongPaths\UpdateManifest_LongPaths.proj(3,3): error MSB4018: at Microsoft.Build.Tasks.UpdateManifest.Execute()
s:\repro\UpdateManifest_LongPaths\UpdateManifest_LongPaths.proj(3,3): error MSB4018: at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute()
s:\repro\UpdateManifest_LongPaths\UpdateManifest_LongPaths.proj(3,3): error MSB4018: at Microsoft.Build.BackEnd.TaskBuilder.<ExecuteInstantiatedTask>d__26.MoveNext()
Done Building Project "s:\repro\UpdateManifest_LongPaths\UpdateManifest_LongPaths.proj" (default targets) -- FAILED.
Build FAILED.
"s:\repro\UpdateManifest_LongPaths\UpdateManifest_LongPaths.proj" (default target) (1) ->
(X target) ->
s:\repro\UpdateManifest_LongPaths\UpdateManifest_LongPaths.proj(3,3): error MSB4018: The "UpdateManifest" task failed unexpectedly.
s:\repro\UpdateManifest_LongPaths\UpdateManifest_LongPaths.proj(3,3): error MSB4018: System.NullReferenceException: Object reference not set to an instance of an object.
s:\repro\UpdateManifest_LongPaths\UpdateManifest_LongPaths.proj(3,3): error MSB4018: at Microsoft.Build.Tasks.Deployment.ManifestUtilities.Manifest.UpdateEntryPoint(String inputPath, String outputPath, String updatedApplicationPath, String applicationManifestPath, String targetFrameworkVersion)
s:\repro\UpdateManifest_LongPaths\UpdateManifest_LongPaths.proj(3,3): error MSB4018: at Microsoft.Build.Tasks.UpdateManifest.Execute()
s:\repro\UpdateManifest_LongPaths\UpdateManifest_LongPaths.proj(3,3): error MSB4018: at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute()
s:\repro\UpdateManifest_LongPaths\UpdateManifest_LongPaths.proj(3,3): error MSB4018: at Microsoft.Build.BackEnd.TaskBuilder.<ExecuteInstantiatedTask>d__26.MoveNext()
0 Warning(s)
1 Error(s)
Time Elapsed 00:00:00.11
Debugging, the problem is a null return from
causing the NRE at
The return is null because the exists check returns false (due to path-too-long)