Home - Forums-.NET - Spices.Net - Project.AddSearchPath not working through C#

Spices.Net

NET code security, tools to protect, obfuscate, tamper defense, code and data safety, recover, convert, optimize, explore, browse and analyze .Net software.

This forum related to following products: Spices.Net Suite, Spices.Net Obfuscator, Spices.Net Decompiler

Project.AddSearchPath not working through C#
Link Posted: 09-Sep-2008 09:48
Greetings, we're embedding Spices into an internal build tool and are hitting a problem.  When obfuscating our applications Spices always asks us to browse for .Net assemblies.  We've added the paths to the .Net assemblies using Project.AddSearchPath, but Spices is ignoring this and asking anyway.

Is there another way to give Spices the search paths?

Quick snippet:


            NineRays.ILOMD.Options.Project project = new NineRays.ILOMD.Options.Project();
            NineRays.ILOMD.Options.AssemblyFileName file = new NineRays.ILOMD.Options.AssemblyFileName(filepath, options);
            Logger logger = new Logger();

            project.AssemblyList.Add(file);
            project.CheckConsistencyBeforeObfuscation = true;
            project.StripDebugInfo = true;
            project.VerifyAfterObfuscation = NineRays.ILOMD.Options.YesNoPrompt.True;
            project.SaveToDirectory = path;

            NineRays.ILOMD.ILOMDProvider obfuscator = new NineRays.ILOMD.ILOMDProvider(logger);

            project.AddSearchPath(@"C:\Windows\Microsoft.NET\Framework\v2.0.50727\");

            if (!obfuscator.Obfuscate(project))
                throw new Exception("Obfuscation failed.");
Link Posted: 25-May-2018 07:12
Hi Hank,
Try to use

//registers project and its searchPaths in AssemblyCollector
obfuscator.Obfuscate(project, true);

instead of
obfuscator.Obfuscate(project);