Ejemplo n.º 1
0
        private string InstrumentResource()
        {
            string resourceName = ResourceServices.CompleteResourceName(GetType(), "TABytecodeChangesSubject");
            string path         = CompilationServices.EmitAssemblyFromResource(resourceName);

            ShellUtilities.ProcessOutput output = InstrumentationServices.InstrumentAssembly("-ta", path);
            Assert.AreEqual(0, output.ExitCode);
            return(path);
        }
        public static AssemblyDefinition AssemblyFromResource(string resourceName, Type simblingType, bool loadSymbols, Action <string> sourceHandler, params Assembly[] references)
        {
            string assemblyPath = CompilationServices.EmitAssemblyFromResource(
                ResourceServices.CompleteResourceName(simblingType, resourceName),
                sourceHandler,
                references);

            ReaderParameters parameters = new ReaderParameters();

            parameters.ReadSymbols = loadSymbols;
            return(AssemblyDefinition.ReadAssembly(assemblyPath, parameters));
        }