A netstandard library that depends on nuget libraries will not be correctly resolved unless the XM or XI library in question also resolves those libraries independently.
The XI and XM library to resolve the nuget required by the netstd library.
The "transitive" dependency of a dependency is not resolved correctly.
https://gist.github.com/chamons/a1fb655991f9bb749168b406e7544cce
https://gist.github.com/chamons/f66954a712614afa70058b63e909041a
Dependency "Newtonsoft.Json, Version=11.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed".
Could not resolve this reference. Could not locate the assembly "Newtonsoft.Json, Version=11.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed". Check to make sure the assembly exists on disk. If this reference is required by your code, you may get compilation errors.
msbuild does not resolve it so it's never given to mmp (or mtouch)
Well then it's an msbuild issue apparently. This "should" work I believe. @jstedfast @radical ?
Any update on this issue?
Should I just add my transitive dependencies as references in my root project as a workaround? Doing this works with my NuGet dependencies.
@chances - I believe that is the best work around until this is sorted out. There is no update currently.
So after some investigation (for a developer community issue), it seems this is kind of the expected behavior: dependencies of .netstandard projects don't flow to the referencing ("old-style") project. This behavior is explained in https://github.com/dotnet/sdk/issues/901.
The fix seems to be to migrate your main project to a PackageReference project, which is fairly simple: https://stackoverflow.com/a/49266856/183422.
For extensions, this also needs an additional fix (the fix for https://github.com/xamarin/xamarin-macios/issues/4237), which should be released to stable together with our iOS 12 supported release fairly soon.
Leaving open so that we can write tests (can't do it quite yet, since we need to build/test with msbuild, which requires 2018-06 to get a version that supports our needs).
So I'm still seeing this problem on resolving native libraries inside nugets.
In this example:
I have two projects:
NetLib has a reference to Microsoft.CognitiveServices.Speech nuget. If the XI project does not, it incorrectly resolves:
~/.nuget/packages/microsoft.cognitiveservices.speech/1.13.0/runtimes/win-x64/native/Microsoft.CognitiveServices.Speech.core.dll
NOT
~/.nuget/packages/microsoft.cognitiveservices.speech/1.13.0//build/Xamarin.iOS/libMicrosoft.CognitiveServices.Speech.core.a
Once I add the nuget to the main XI project, it starts working.
Most helpful comment
So after some investigation (for a developer community issue), it seems this is kind of the expected behavior: dependencies of .netstandard projects don't flow to the referencing ("old-style") project. This behavior is explained in https://github.com/dotnet/sdk/issues/901.
The fix seems to be to migrate your main project to a PackageReference project, which is fairly simple: https://stackoverflow.com/a/49266856/183422.
For extensions, this also needs an additional fix (the fix for https://github.com/xamarin/xamarin-macios/issues/4237), which should be released to stable together with our iOS 12 supported release fairly soon.
Leaving open so that we can write tests (can't do it quite yet, since we need to build/test with msbuild, which requires 2018-06 to get a version that supports our needs).