예제 #1
0
        public void AssemblyInstallationTest()
        {
            Assembly current = Assembly.GetExecutingAssembly();

            Assembly toLoad = null;

            AzureGAC azureGAC = new AzureGAC(connString);
            bool     res      = azureGAC.TryLoadAssembly(current.FullName, out toLoad);

            Assert.IsFalse(res);
            Assert.IsNull(toLoad);

            AzureGAC.Install(connString, current);
            res = azureGAC.TryLoadAssembly(current.FullName, out toLoad);
            Assert.IsTrue(res);
            Assert.IsNotNull(toLoad);

            var someExtractedData = toLoad.GetExportedTypes();
        }
예제 #2
0
        public void DoubleInstallationTest()
        {
            Assembly current = Assembly.LoadFile(System.IO.Path.GetFullPath("testAss1.exe"));

            Assembly toLoad = null;

            AzureGAC azureGAC = new AzureGAC(connString);
            bool     res      = azureGAC.TryLoadAssembly(current.FullName, out toLoad);

            Assert.IsFalse(res);
            Assert.IsNull(toLoad);

            AzureGAC.Install(connString, current);
            AzureGAC.Install(connString, current);
            res = azureGAC.TryLoadAssembly(current.FullName, out toLoad);
            Assert.IsTrue(res);
            Assert.IsNotNull(toLoad);

            var someExtractedData = toLoad.GetExportedTypes();
        }
예제 #3
0
        public void AssemblyConflictTest()
        {
            Assembly toLoad1 = Assembly.LoadFile(System.IO.Path.GetFullPath("testAss1.exe"));
            Assembly toLoad2 = Assembly.LoadFile(System.IO.Path.GetFullPath("testAss2.exe"));

            AzureGAC azureGAC = new AzureGAC(connString);

            //System.Runtime.Serialization.Formatters.Binary.BinaryFormatter formatter = new System.Runtime.Serialization.Formatters.Binary.BinaryFormatter();
            //using (System.IO.FileStream assemblyStream = new System.IO.FileStream("1.exe",System.IO.FileMode.Create))
            //{
            //    formatter.Serialize(assemblyStream, toLoad1);
            //}

            //using (System.IO.FileStream assemblyStream = new System.IO.FileStream("2.exe", System.IO.FileMode.Create))
            //{
            //    formatter.Serialize(assemblyStream, toLoad2);
            //}

            AzureGAC.Install(connString, toLoad1);
            AzureGAC.Install(connString, toLoad2);
        }