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

After updating Visual Studio 2017 (including Xamarin), I get an error message in several Nuget packages, for example:

... \ MSBuild \ Xamarin \ Xamarin.Apple.Sdk.targets (29.5): error MSB4096: element ".... nuget \ packages \ HockeySDK.Xamarin \ 4.1.3 \ lib \ Xamarin. IOS10 \ HockeySDK. dll "in the list of items" ReferenceCopyLocalPaths "does not define a value for the metadata" ResolvedFrom ". To use this metadata, either qualify it with% (ReferenceCopyLocalPaths.ResolvedFrom), or make sure that all the items in this list define the value for this metadata.

The error only occurs when creating for Xamarin.iOS. It works great for Android.

Does anyone know how to fix this?

+5
source share
2 answers

I was able to fix this for my own solution by modifying the Xamarin.Apple.Sdk.targets file located in 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

+7
source

Until 2015, this file is located in the C: \ Program Files (x86) \ MSBuild \ Xamarin folder.

The final fix we will post is to add this right after line 23:

<ResolvedFrom />

So, the element definition group is as follows:

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

0
source

All Articles