protected ProcessAssemblyBaseTest( string relativePath ) { BeforeAssemblyPath = Path.GetFullPath( relativePath ); #if !DEBUG BeforeAssemblyPath = BeforeAssemblyPath.Replace("Debug", "Release"); #endif AfterAssemblyPath = BeforeAssemblyPath.Replace( ".dll", "2.dll" ); File.Copy( BeforeAssemblyPath, AfterAssemblyPath, true ); var moduleDefinition = ModuleDefinition.ReadModule( AfterAssemblyPath ); var currentDirectory = AssemblyLocation.CurrentDirectory(); PersistentInfo = PersistentInfo.LoadFromPath( currentDirectory ); StandardInfo = new StandardInfo( PersistentInfo, moduleDefinition ); var moduleWeaver = new ModuleWeaver { ModuleDefinition = moduleDefinition, AddinDirectoryPath = currentDirectory, SolutionDirectoryPath = currentDirectory, AssemblyFilePath = AfterAssemblyPath, }; moduleWeaver.Execute(); moduleDefinition.Write( AfterAssemblyPath ); moduleWeaver.AfterWeaving(); AfterAssembly = Assembly.LoadFile( AfterAssemblyPath ); }
public StandardInfo( PersistentInfo p, ModuleDefinition m ) : this(p, m.Assembly.Name.Version) { }
public StandardInfo( PersistentInfo p, Version assemblyVersion ) { Persistent = p; AssemblyVersion = assemblyVersion; }