I have a .NET Standard 1.4 class library that references the System.ComponentModel.Annotations (4.3.0) NuGet package.
I\'m then referencing this class library from a
Got it working by using assembly redirection as described in:
just invoke FunctionsAssemblyResolver.RedirectAssembly() in the begining of your program.
https://stackoverflow.com/a/50776946/2705777
using System.Reflection;
using System.Diagnostics;
using System.Linq;
public class FunctionsAssemblyResolver
{
public static void RedirectAssembly()
{
var list = AppDomain.CurrentDomain.GetAssemblies().OrderByDescending(a => a.FullName).Select(a => a.FullName).ToList();
AppDomain.CurrentDomain.AssemblyResolve += CurrentDomain_AssemblyResolve;
}
private static Assembly CurrentDomain_AssemblyResolve(object sender, ResolveEventArgs args)
{
var requestedAssembly = new AssemblyName(args.Name);
Assembly assembly = null;
AppDomain.CurrentDomain.AssemblyResolve -= CurrentDomain_AssemblyResolve;
try
{
assembly = Assembly.Load(requestedAssembly.Name);
}
catch (Exception ex)
{
}
AppDomain.CurrentDomain.AssemblyResolve += CurrentDomain_AssemblyResolve;
return assembly;
}
}