Exemplo n.º 1
0
        private static IAssembly LoadDll()
        {
            var loader = new AssemblySystem();
            var anyCpu = loader.GetAnyCpuPath(loader.BaseDirectory);

            loader.AddSearchPath(anyCpu);
            var module = loader.LoadFrom(anyCpu, "NativeLibrary.dll");

            return(module);
        }
Exemplo n.º 2
0
        public void TestDllDependenciesLoading()
        {
            var loader = new AssemblySystem();

            // C# loads C++ from Win32 or x64 subfolder
            var anyCpu = loader.GetAnyCpuPath(loader.BaseDirectory);

            loader.AddSearchPath(anyCpu);
            var module = loader.LoadFrom(anyCpu, "NativeLibraryConsumer.dll");
            var fn     = module.GetDelegate <fnNativeLibraryConsumer>();

            object[] retval;

            Assert.IsTrue(42 == fn(out retval));
            loader.Dispose();
        }
Exemplo n.º 3
0
 private static IAssembly LoadDll()
 {
     var loader = new AssemblySystem();
     var anyCpu = loader.GetAnyCpuPath(loader.BaseDirectory);
     loader.AddSearchPath(anyCpu);
     var module = loader.LoadFrom(anyCpu, "NativeLibrary.dll");
     return module;
 }
Exemplo n.º 4
0
        public void TestDllDependenciesLoading()
        {
            var loader = new AssemblySystem();

            // C# loads C++ from Win32 or x64 subfolder
            var anyCpu = loader.GetAnyCpuPath(loader.BaseDirectory);
            loader.AddSearchPath(anyCpu);
            var module = loader.LoadFrom(anyCpu, "NativeLibraryConsumer.dll");
            var fn = module.GetDelegate<fnNativeLibraryConsumer>();
            object[] retval;

            Assert.IsTrue(42 == fn(out retval));
            loader.Dispose();
        }