obfuscar icon indicating copy to clipboard operation
obfuscar copied to clipboard

System.NullReferenceException when referenced project is about to be called

Open quicoli opened this issue 5 years ago • 1 comments

Hello,

I'm trying out obfuscar but I'm facing a weird situation. I have a WPF (.net 4.5.2) that references a .net library (.net 4.5.2). When I run the app without obfuscate, everything works. After obfuscation my main app is executed normally but when I try to perform an action that is done by my .net library I get this:

System.NullReferenceException: Object reference not set to an instance of an object. at A.A.a(String ) at MyApp.MainWindow.A(Object , RoutedEventArgs )

This is my xml:

<?xml version='1.0'?>
<Obfuscator>
  <Var name="InPath" value="." />
  <Var name="OutPath" value=".\Obfuscator_Output" />
  <Var name="KeepPublicApi" value="false" />
  <Var name="HidePrivateApi" value="true" />
  <Module file="$(InPath)\MyApp.exe" />
  <Module file="$(InPath)\Encryption.dll" />
</Obfuscator>

Any idea?

thank you very much.

quicoli avatar Jun 25 '19 15:06 quicoli

WPF or your own code can rely on certain names to remain the same (while obfuscation can change them). Debug the obfuscated code (with the new symbol file generated), so that you can dig more out.

lextm avatar Jun 25 '19 18:06 lextm