Skip to content

Instantly share code, notes, and snippets.

@jfmaes
Created December 21, 2020 09:53
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jfmaes/9602fccc0805a79eee5ee87d819dd2c9 to your computer and use it in GitHub Desktop.
Save jfmaes/9602fccc0805a79eee5ee87d819dd2c9 to your computer and use it in GitHub Desktop.
example ingestor of NvisoLib for the blogpost
using System;
using NvisoLib;
using System.Reflection;
namespace AppDomainResolveTest
{
class Program
{
static void Main(string[] args)
{
AppDomain.CurrentDomain.AssemblyResolve += ResolveAssembly;
SomeDLLFunction();
}
static void SomeDLLFunction()
{
NvisoLib.Test test = new NvisoLib.Test();
test.Say("hi from nvisolib");
}
static Assembly ResolveAssembly(object sender, ResolveEventArgs args)
{
Assembly asm = null;
String name = new AssemblyName(args.Name).Name;
Console.WriteLine("attempting to load {0} from an external location.",name);
asm = Assembly.LoadFrom(@"C:\Users\jeanm\source\repos\NvisoLib\bin\Release\"+name+".dll");
return asm;
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment