I'm not 100% clear on the latest NuGet behaviour - so would appreciate a second opinion on the below. This is what I think is going on in nunit/nunit.xamarin#87.
Out .NET Standard 1.6 build relies on System.Runtime.Loader 4.3.0. If you unzip that NuGet package, the structure looks like this:
lib -> netstandard1.5 -> System.Runtime.Loader.dll
net462 -> _._
MonoAndroid10 -> _._
MonoTouch10 -> _._
When this package is installed into an Android project (and I assume .NET Framework 4.6.2, or iOS also) - NuGet resolves to look in the MonoAndroid10 directory, and finds the _._ (and fails). As I understand (although I can't find anything official on the matter) - this is used as a placeholder, when an API isn't supported on a certain platform yet. See below:
https://github.com/dotnet/corefx/issues/8965#issuecomment-287138692
https://github.com/dotnet/corefx/issues/11023#issuecomment-244131549
If I'm understanding the above correctly, then our .NET Standard 1.6 NuGet package won't actually work for iOS, Android, or .NET 4.6.2. I'd assume we're only just discovering this as .NET Core is unaffected, which I imagine is the main use of the .NET Standard builds.
As a potential solution, perhaps we could package the NET Standard 1.3 build of NUnit (which doesn't rely on System.Runtime.Loader) under a monoandroid directory in our NuGet package. (And of course additionally for the remaining affected frameworks.) Project.json unfortunately seems to ignore such subdirectories (unlike packages.config, which recognises them...) - but I wonder if that's the same issue we saw in #2165, which would be fixed by adding an empty dependency group for MonoAndroid etc. Not sure.
It's only the latest Android framework which pulls in .NET Standard I believe, which I imagine is why we didn't see this issue when Rob first created the .NET Standard 1.6 build. Unfortunately, unless someone knows a way to force project.json to look in a particular subdirectory for it's dependency, I think this could potentially be critical for both NUnit and nunit.xamarin.
I'm not 100% clear on the latest NuGet behaviour - so would appreciate a second opinion on the below. This is what I think is going on in nunit/nunit.xamarin#87.
Out .NET Standard 1.6 build relies on System.Runtime.Loader 4.3.0. If you unzip that NuGet package, the structure looks like this:
When this package is installed into an Android project (and I assume .NET Framework 4.6.2, or iOS also) - NuGet resolves to look in the
MonoAndroid10directory, and finds the_._(and fails). As I understand (although I can't find anything official on the matter) - this is used as a placeholder, when an API isn't supported on a certain platform yet. See below:https://github.com/dotnet/corefx/issues/8965#issuecomment-287138692
https://github.com/dotnet/corefx/issues/11023#issuecomment-244131549
If I'm understanding the above correctly, then our .NET Standard 1.6 NuGet package won't actually work for iOS, Android, or .NET 4.6.2. I'd assume we're only just discovering this as .NET Core is unaffected, which I imagine is the main use of the .NET Standard builds.
As a potential solution, perhaps we could package the NET Standard 1.3 build of NUnit (which doesn't rely on System.Runtime.Loader) under a
monoandroiddirectory in our NuGet package. (And of course additionally for the remaining affected frameworks.) Project.json unfortunately seems to ignore such subdirectories (unlike packages.config, which recognises them...) - but I wonder if that's the same issue we saw in #2165, which would be fixed by adding an empty dependency group for MonoAndroid etc. Not sure.It's only the latest Android framework which pulls in .NET Standard I believe, which I imagine is why we didn't see this issue when Rob first created the .NET Standard 1.6 build. Unfortunately, unless someone knows a way to force project.json to look in a particular subdirectory for it's dependency, I think this could potentially be critical for both NUnit and nunit.xamarin.