Problem with Dotfuscator, what's wrong with my code?

euthymos
09-26-2006, 01:41 AM
I'm trying to obfuscate my project with Dotfuscator, but I have a serious problem.


Please, look at this example:


Public Class Engine

Dim MyConstants As New ProgConstants()

Public Function ExampleFunction() As String
MsgBox(MyConstants.TheFunction)
End Function

End Class



Public Class ProgConstants

Public Function TheFunction() As String
Return ' something.....
End Function

End Class



If I normally compile and run the project, all works fine. But if I "obfuscate" the assembly .exe with Netfuscator, I get an error when executing the function ExampleFunction telling me that the "TheFunction" method in the class "sg" (apparently the class has been renamed) could not be found.

What's wrong with my code?

euthymos
09-26-2006, 01:56 AM
Solved.

I had to use:
Private MyConstants As New ProgConstants()

instead of:
Dim MyConstants As New ProgConstants()


It's very, very strange that "Dim" (which is obviously wrong in this case) is accepted...

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum