Bug 55480 - WatchPuzzle sample fails with msbuild
Summary: WatchPuzzle sample fails with msbuild
Status: VERIFIED FIXED
Alias: None
Product: iOS
Classification: Xamarin
Component: MSBuild ()
Version: XI 10.10 (d15-2)
Hardware: PC Mac OS
: --- normal
Target Milestone: 15.2
Assignee: Ankit Jain
URL:
Depends on:
Blocks: 55389
  Show dependency tree
 
Reported: 2017-04-22 01:29 UTC by Ankit Jain
Modified: 2017-05-09 21:12 UTC (History)
5 users (show)

Tags:
Is this bug a regression?: ---
Last known good build:

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.


Please create a new report on Developer Community or GitHub with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:
Status:
VERIFIED FIXED

Description Ankit Jain 2017-04-22 01:29:12 UTC
Task CompileSceneKitAssets fails with msbuild:

error MSB4018: System.ArgumentException: "DefiningProjectFullPath" is a reserved item metadata, and cannot be modified or deleted.


"/Users/ankit/dev/ios-samples/watchOS/WatchPuzzle/WatchPuzzle.sln" (default target) (1) ->
"/Users/ankit/dev/ios-samples/watchOS/WatchPuzzle/WatchPuzzle/WatchPuzzle.csproj" (default target) (2) ->
"/Users/ankit/dev/ios-samples/watchOS/WatchPuzzle/WatchPuzzle.WatchKitApp/WatchPuzzle.WatchKitApp.csproj" (default target) (3) ->
"/Users/ankit/dev/ios-samples/watchOS/WatchPuzzle/WatchPuzzle.WatchKitAppExtension/WatchPuzzle.WatchKitAppExtension.csproj" (default target) (4) ->
(_CoreCompileSceneKitAssets target) ->
  /Library/Frameworks/Mono.framework/External/xbuild/Xamarin/iOS/Xamarin.iOS.Common.targets(1230,3): error MSB4018: The "CompileSceneKitAssets" task failed unexpectedly. [/Users/ankit/dev/ios-samples/watchOS/WatchPuzzle/WatchPuzzle.WatchKitAppExtension/WatchPuzzle.WatchKitAppExtension.csproj]
/Library/Frameworks/Mono.framework/External/xbuild/Xamarin/iOS/Xamarin.iOS.Common.targets(1230,3): error MSB4018: This is an unhandled exception from a task -- PLEASE OPEN A BUG AGAINST THE TASK OWNER. [/Users/ankit/dev/ios-samples/watchOS/WatchPuzzle/WatchPuzzle.WatchKitAppExtension/WatchPuzzle.WatchKitAppExtension.csproj]
/Library/Frameworks/Mono.framework/External/xbuild/Xamarin/iOS/Xamarin.iOS.Common.targets(1230,3): error MSB4018: System.ArgumentException: "DefiningProjectFullPath" is a reserved item metadata, and cannot be modified or deleted. [/Users/ankit/dev/ios-samples/watchOS/WatchPuzzle/WatchPuzzle.WatchKitAppExtension/WatchPuzzle.WatchKitAppExtension.csproj]
/Library/Frameworks/Mono.framework/External/xbuild/Xamarin/iOS/Xamarin.iOS.Common.targets(1230,3): error MSB4018:   at Microsoft.Build.Shared.ErrorUtilities.ThrowArgument (System.Exception innerException, System.String resourceName, System.Object[] args) [0x00012] in /Users/ankit/dev/msbuild/src/Shared/ErrorUtilities.cs:472  [/Users/ankit/dev/ios-samples/watchOS/WatchPuzzle/WatchPuzzle.WatchKitAppExtension/WatchPuzzle.WatchKitAppExtension.csproj]
/Library/Frameworks/Mono.framework/External/xbuild/Xamarin/iOS/Xamarin.iOS.Common.targets(1230,3): error MSB4018:   at Microsoft.Build.Shared.ErrorUtilities.VerifyThrowArgument (System.Boolean condition, System.Exception innerException, System.String resourceName, System.Object arg0) [0x0000a] in /Users/ankit/dev/msbuild/src/Shared/ErrorUtilities.cs:604  [/Users/ankit/dev/ios-samples/watchOS/WatchPuzzle/WatchPuzzle.WatchKitAppExtension/WatchPuzzle.WatchKitAppExtension.csproj]
/Library/Frameworks/Mono.framework/External/xbuild/Xamarin/iOS/Xamarin.iOS.Common.targets(1230,3): error MSB4018:   at Microsoft.Build.Shared.ErrorUtilities.VerifyThrowArgument (System.Boolean condition, System.String resourceName, System.Object arg0) [0x00001] in /Users/ankit/dev/msbuild/src/Shared/ErrorUtilities.cs:505  [/Users/ankit/dev/ios-samples/watchOS/WatchPuzzle/WatchPuzzle.WatchKitAppExtension/WatchPuzzle.WatchKitAppExtension.csproj]
/Library/Frameworks/Mono.framework/External/xbuild/Xamarin/iOS/Xamarin.iOS.Common.targets(1230,3): error MSB4018:   at Microsoft.Build.Utilities.TaskItem.SetMetadata (System.String metadataName, System.String metadataValue) [0x0000d] in /Users/ankit/dev/msbuild/src/Utilities/TaskItem.cs:287  [/Users/ankit/dev/ios-samples/watchOS/WatchPuzzle/WatchPuzzle.WatchKitAppExtension/WatchPuzzle.WatchKitAppExtension.csproj]
/Library/Frameworks/Mono.framework/External/xbuild/Xamarin/iOS/Xamarin.iOS.Common.targets(1230,3): error MSB4018:   at (wrapper remoting-invoke-with-check) Microsoft.Build.Utilities.TaskItem:SetMetadata (string,string) [/Users/ankit/dev/ios-samples/watchOS/WatchPuzzle/WatchPuzzle.WatchKitAppExtension/WatchPuzzle.WatchKitAppExtension.csproj]
/Library/Frameworks/Mono.framework/External/xbuild/Xamarin/iOS/Xamarin.iOS.Common.targets(1230,3): error MSB4018:   at Xamarin.MacDev.Tasks.CompileSceneKitAssetsTaskBase.Execute () [0x00233] in <fb308d739fda475bae1f7307a5468418>:0  [/Users/ankit/dev/ios-samples/watchOS/WatchPuzzle/WatchPuzzle.WatchKitAppExtension/WatchPuzzle.WatchKitAppExtension.csproj]
/Library/Frameworks/Mono.framework/External/xbuild/Xamarin/iOS/Xamarin.iOS.Common.targets(1230,3): error MSB4018:   at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute () [0x0002a] in /Users/ankit/dev/msbuild/src/Build/BackEnd/TaskExecutionHost/TaskExecutionHost.cs:632  [/Users/ankit/dev/ios-samples/watchOS/WatchPuzzle/WatchPuzzle.WatchKitAppExtension/WatchPuzzle.WatchKitAppExtension.csproj]
/Library/Frameworks/Mono.framework/External/xbuild/Xamarin/iOS/Xamarin.iOS.Common.targets(1230,3): error MSB4018:   at Microsoft.Build.BackEnd.TaskBuilder+<ExecuteInstantiatedTask>d__26.MoveNext () [0x002bf] in /Users/ankit/dev/msbuild/src/Build/BackEnd/Components/RequestBuilder/TaskBuilder.cs:787  [/Users/ankit/dev/ios-samples/watchOS/WatchPuzzle/WatchPuzzle.WatchKitAppExtension/WatchPuzzle.WatchKitAppExtension.csproj]
Comment 1 Ankit Jain 2017-04-22 01:33:04 UTC
WatchPuzzle: watchOS/WatchPuzzle/WatchPuzzle.sln

Also:
ios9/Fox/Fox.sln
ios8/SceneKitVehicle/SceneKitVehicle.sln
Comment 2 Sebastien Pouliot 2017-04-24 12:32:08 UTC
So it seems bug #55389 will be a duplicate, since it mention the two other samples from comment #1.
Comment 3 Jeffrey Stedfast 2017-04-24 15:08:44 UTC
The solution is probably something like this:

diff --git a/msbuild/Xamarin.MacDev.Tasks.Core/Tasks/CompileSceneKitAssetsTaskBase.cs b/msbuild/Xamarin.MacDev.Tasks.Core/Tasks/CompileSceneKitAssetsTaskBase.cs
index a3a4a2f9..9412bb49 100644
--- a/msbuild/Xamarin.MacDev.Tasks.Core/Tasks/CompileSceneKitAssetsTaskBase.cs
+++ b/msbuild/Xamarin.MacDev.Tasks.Core/Tasks/CompileSceneKitAssetsTaskBase.cs
@@ -177,9 +177,7 @@ namespace Xamarin.MacDev.Tasks
                                if (!modified.Contains (scnassets) && (!File.Exists (output.ItemSpec) || File.GetLastWriteTimeUtc (asset.ItemSpec) > File.GetLastWriteTimeUtc (output.ItemSpec))) {
                                        var item = new TaskItem (scnassets);
 
-                                       metadata = asset.GetMetadata ("DefiningProjectFullPath");
-                                       if (!string.IsNullOrEmpty (metadata))
-                                               item.SetMetadata ("DefiningProjectFullPath", metadata);
+                                       asset.CopyMetadataTo (item);
 
                                        modified.Add (scnassets);
                                        items.Add (item);
Comment 4 Ankit Jain 2017-04-24 20:18:46 UTC
Fixed by https://github.com/xamarin/xamarin-macios/pull/2034 .
Comment 5 Roshan Mankani 2017-05-09 10:15:11 UTC
Hello @Ankit Jain,
Can you please provide proper steps or description with expected condition for verify this bug.
Comment 6 GouriKumari 2017-05-09 21:12:11 UTC
WatchPuzzle build successfully from command line using msbuild. Hence, I am closing this bug.