harschell / obfuscar

Automatically exported from code.google.com/p/obfuscar
0 stars 0 forks source link

Obfuscator crashes when trying to obfuscate two assemblies in a row using one config file #30

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1.

I have two assemblies, one class library, another an exe. I am trying to
obfuscate both at the same time using a config file similar to the following:

<?xml version='1.0'?>
<Obfuscator>
  <Var name="InPath" value=".\Obfuscator_Input" />
  <Var name="OutPath" value=".\Obfuscator_Output" />
  <Var name="ReuseNames" value="true" />
  <Module file="$(InPath)\myexe.exe"/>
  <Module file="$(InPath)\somecontrols.dll"/>
</Obfuscator>

When I run the tool, it crashes with (full output):
Loading project...Loading assemblies...Done.
Renaming:  fields...parameters...properties...events...methods...types...
Unhandled Exception: System.ArgumentException: An item with the same key
has already been added.
   at System.ThrowHelper.ThrowArgumentException(ExceptionResource resource)
   at System.Collections.Generic.Dictionary`2.Insert(TKey key, TValue
value, Boolean add)
   at Obfuscar.Obfuscator.RenameTypes()
   at Obfuscar.Program.Main(String[] args)

Note that running two separate config files for each assembly works just fine.

2.
3.

What is the expected output? What do you see instead?

No app crash.

What version of the product are you using? On what operating system?

1.5.4. Win XP with SP3

Please provide any additional information below.

Original issue reported on code.google.com by radun...@gmail.com on 28 Feb 2010 at 7:03

GoogleCodeExporter commented 8 years ago
Please check that there are no duplicate types with the same class name and 
namespace
in both assemblies.
Obfuscar does not handle duplicate types even when they are marked private or 
internal.

Werner

Original comment by webbi...@gmail.com on 1 Mar 2010 at 8:33

GoogleCodeExporter commented 8 years ago
I'm sure there are duplicate types, the exe uses some of the types declared in 
the dll. 
Shouldn't Obfuscar be able to handle it? It's not a big deal, I can use two 
separate 
config files and run the tool twice.

Original comment by radun...@gmail.com on 2 Mar 2010 at 4:33

GoogleCodeExporter commented 8 years ago
Should have been Closed, as now TypeKey takes scope (assembly) into 
consideration.

Original comment by lextu...@gmail.com on 28 Apr 2013 at 7:26