Hi @JarvanZhang , thanks for answering.
When you use multi targing project template in Visual Studio, its create automatically one class as this:
public static class CrossMultiTargeting
{
static Lazy<IMultiTargeting> implementation =
new Lazy<IMultiTargeting>(() => CreateMultiTargeting(), System.Threading.LazyThreadSafetyMode.PublicationOnly);
public static bool IsSupported => implementation.Value == null ? false : true;
public static IMultiTargeting Current
{
get
{
IMultiTargeting ret = implementation.Value;
if (ret == null)
{
throw NotImplementedInReferenceAssembly();
}
return ret;
}
}
static IMultiTargeting CreateMultiTargeting()
{
#if NETSTANDARD1_0 || NETSTANDARD2_0
return null;
#else
return new MultiTargetingImplementation();
#endif
}
internal static Exception NotImplementedInReferenceAssembly() =>
new NotImplementedException("...");
}
The exception is throwed because the method CreateMultiTargeting return null.
I need know how can I use this kind of project for make plugins.