Marcel Wolterbeek
Marcel Wolterbeek

Reputation: 3702

Xamarin.iOS build error MSB4096: "ReferenceCopyLocalPaths" does not define a value for metadata "ResolvedFrom"

After updating Visual Studio 2017 (including Xamarin) I get an error on several Nuget packages like:

...\MSBuild\Xamarin\Xamarin.Apple.Sdk.targets(29,5): error MSB4096: The item "....nuget\packages\HockeySDK.Xamarin\4.1.3\lib\Xamarin.iOS10\HockeySDK.dll" in item list "ReferenceCopyLocalPaths" does not define a value for metadata "ResolvedFrom". In order to use this metadata, either qualify it by specifying %(ReferenceCopyLocalPaths.ResolvedFrom), or ensure that all items in this list define a value for this metadata.

The error only occurs when building for Xamarin.iOS. Building for Android works fine.

Does anybody know how to fix this?

Upvotes: 5

Views: 736

Answers (2)

kzu
kzu

Reputation: 1871

Under 2015, that file is in C:\Program Files (x86)\MSBuild\Xamarin.

The final fix we'll ship is to add this right after line 23:

<ResolvedFrom />

So the item definition group looks like this:

<ItemDefinitionGroup> <ReferenceCopyLocalPaths> <DestinationSubDirectory /> <FrameworkFile /> <ResolvedFrom /> </ReferenceCopyLocalPaths> </ItemDefinitionGroup>

Upvotes: 0

Jeremy
Jeremy

Reputation: 86

I was able to fix this for my own solution by modifying the Xamarin.Apple.Sdk.targets file located at C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\MSBuild\Xamarin. I added the ReferenceCopyLocalPaths qualification to lines 31 and 35.

Line 31

<FrameworkFile>$([System.String]::new('%(ReferenceCopyLocalPaths.ResolvedFrom)').StartsWith('$(FrameworkPathOverride)').ToString().ToLowerInvariant())</FrameworkFile>

Line 35

'%(ReferenceCopyLocalPaths.ResolvedFrom)' != 'ImplicitlyExpandDesignTimeFacades' And

Upvotes: 7

Related Questions