13-07-21 10:58 AM
Answered! Go to Answer.
09-03-22 01:59 PM
13-07-21 12:04 PM
04-03-22 07:27 PM
04-03-22 08:32 PM
09-03-22 06:38 AM
09-03-22 01:59 PM
16-06-22 06:47 PM
17-06-22 03:31 AM
17-06-22 08:00 AM
public static void RedirectAssembly(string shortName, Version targetVersion, string publicKeyToken) {
ResolveEventHandler handler = null;
handler = (sender, args) => {
// Use latest strong name & version when trying to load SDK assemblies
var requestedAssembly = new AssemblyName(args.Name);
if (requestedAssembly.Name != shortName)
return null;
requestedAssembly.Version = targetVersion;
requestedAssembly.SetPublicKeyToken(new AssemblyName("x, PublicKeyToken=" + publicKeyToken).GetPublicKeyToken());
requestedAssembly.CultureInfo = CultureInfo.InvariantCulture;
AppDomain.CurrentDomain.AssemblyResolve -= handler;
return Assembly.Load(requestedAssembly);
};
AppDomain.CurrentDomain.AssemblyResolve += handler;
}
17-06-22 10:00 AM