Class library and dotfuscator

  • Thread starter Thread starter mart_nl
  • Start date Start date
M

mart_nl

Hi group,

I have a class library containing a Windows form. I create a dll from
this project and use it in my application like so:

Assembly asm =
System.Reflection.Assembly.LoadFrom("path_to_file.dll");

Form newForm = new Form();
newForm = (Form)asm.CreateInstance("Namespace.frmTestform");

newMDIChild = newForm;

This works like a charm. I now put all the dll's like this in one
directory and load them into my app.

Now the problem comes when I use Dotfuscator. The line that says:
newMDIChild = newForm;

Gives me a null exception error. I can set Dotfuscator to "library"
mode and then my code works again. However the library is easy to
decompile.

So I'd like to know if it is at all possible to load the assembly in
any other way and still be able to fully use dotfuscator. I do I have
to settle for less protection?

Kind regards,
Martin.
 
I have a class library containing a Windows form. I create a dll from
this project and use it in my application like so:

Assembly asm =
System.Reflection.Assembly.LoadFrom("path_to_file.dll");

Form newForm = new Form();
newForm = (Form)asm.CreateInstance("Namespace.frmTestform");

newMDIChild = newForm;

This works like a charm. I now put all the dll's like this in one
directory and load them into my app.

Now the problem comes when I use Dotfuscator. The line that says:
newMDIChild = newForm;

Gives me a null exception error. I can set Dotfuscator to "library"
mode and then my code works again. However the library is easy to
decompile.

So I'd like to know if it is at all possible to load the assembly in
any other way and still be able to fully use dotfuscator. I do I have
to settle for less protection?

I will assume that when mode library the obfuscator keeps
public names.

Maybe you could change more names to internal.

Else you could look for an obfuscator that allows you to
list names to exclude from obfuscation.

Arne
 
I will assume that when mode library the obfuscator keeps
public names.

Maybe you could change more names to internal.

Else you could look for an obfuscator that allows you to
list names to exclude from obfuscation.

Arne

Hi Arne,

Thank you for your help. I will look at changing names to internal.
And I also thought about making a
seperate class where I would put all the "sensitive" coding. If I
reference the class from the "form class"
I could totally obfuscate that class yet leave the class with the form
untouched (library mode).

Martin.
 
Back
Top