@@ -88,17 +88,16 @@ static void RunInternal(ConfuserParameters parameters, CancellationToken token)
8888 try {
8989 // Enable watermarking by default
9090 context . Project . Rules . Insert ( 0 , new Rule {
91- new SettingItem < Protection > ( WatermarkingProtection . _Id ) ,
92- new SettingItem < Protection > ( "harden" )
91+ new SettingItem < Protection > ( WatermarkingProtection . _Id )
9392 } ) ;
9493
9594 var asmResolver = new AssemblyResolver ( ) ;
9695 asmResolver . EnableTypeDefCache = true ;
9796 asmResolver . DefaultModuleContext = new ModuleContext ( asmResolver ) ;
9897 context . Resolver = asmResolver ;
99- context . BaseDirectory = Path . Combine ( Environment . CurrentDirectory , parameters . Project . BaseDirectory . TrimEnd ( Path . DirectorySeparatorChar ) + Path . DirectorySeparatorChar ) ;
100- context . OutputDirectory = Path . Combine ( parameters . Project . BaseDirectory , parameters . Project . OutputDirectory . TrimEnd ( Path . DirectorySeparatorChar ) + Path . DirectorySeparatorChar ) ;
101- foreach ( string probePath in parameters . Project . ProbePaths )
98+ context . BaseDirectory = Path . Combine ( Environment . CurrentDirectory , context . Project . BaseDirectory . TrimEnd ( Path . DirectorySeparatorChar ) + Path . DirectorySeparatorChar ) ;
99+ context . OutputDirectory = Path . Combine ( context . Project . BaseDirectory , context . Project . OutputDirectory . TrimEnd ( Path . DirectorySeparatorChar ) + Path . DirectorySeparatorChar ) ;
100+ foreach ( string probePath in context . Project . ProbePaths )
102101 asmResolver . PostSearchPaths . Insert ( 0 , Path . Combine ( context . BaseDirectory , probePath ) ) ;
103102
104103 context . CheckCancellation ( ) ;
@@ -128,7 +127,7 @@ static void RunInternal(ConfuserParameters parameters, CancellationToken token)
128127 throw new ConfuserException ( ex ) ;
129128 }
130129
131- components . Insert ( 0 , new CoreComponent ( parameters , marker ) ) ;
130+ components . Insert ( 0 , new CoreComponent ( context , marker ) ) ;
132131 foreach ( Protection prot in prots )
133132 components . Add ( prot ) ;
134133 foreach ( Packer packer in packers )
@@ -139,7 +138,7 @@ static void RunInternal(ConfuserParameters parameters, CancellationToken token)
139138 // 4. Load modules
140139 context . Logger . Info ( "Loading input modules..." ) ;
141140 marker . Initalize ( prots , packers ) ;
142- MarkerResult markings = marker . MarkProject ( parameters . Project , context ) ;
141+ MarkerResult markings = marker . MarkProject ( context . Project , context ) ;
143142 context . Modules = new ModuleSorter ( markings . Modules ) . Sort ( ) . ToList ( ) . AsReadOnly ( ) ;
144143 foreach ( var module in context . Modules )
145144 module . EnableTypeDefFindCache = false ;
0 commit comments