Home - Forums-.NET - Spices.Net - public member not found error

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

public member not found error
Link Posted: 01-Mar-2007 21:42
I am distribute Dll asembly and use Spice 5.0 to obfucate with option:
{Naming=NonDisplayable}{StringEncryptionMode=Encrypt}{Members=Namespaces, Fields, Public, Interfaces, Parameters, Overridables, Protected, LeaveGeneratedByCompiler, LeaveDebuggerHidden}
when run error occus like that
\"Public member 'Meber name' on type 'Typename' not found\"
Please show me how to correct this propblem!
Link Posted: 01-Mar-2007 23:14
Probably some public class, that used in reflection/serialization was obfuscated. Please turn off public members (ObfuscationOptions.Members.Public option) or you can exclude members used in reflection/serialization manually (by using Excludes, ExclusionPatterns, or by marking excluded members by NotObfuscate attribute)to solve this problem.
Link Posted: 02-Mar-2007 16:41
Please show me how to use Declarative Obfuscation in VB.NET
Link Posted: 03-Mar-2007 00:57
1. Add to your project's references NineRays.ObfuscationAttributes.dll assembly that you can find in the \\SDK\\Obfuscation Attributes\\ folder of spices.net installation folder.
2. Add to the Imports declarations in your .vb file following line:
Imports NineRays.Obfuscator
3. Attach to the member that you can exclude from obfuscation following attribute:
Before attaching:
[VB.Net]
Namespace MyNamespace
  Public Class MyClass
    Inherits Object
    Private _name As String
    Public Property MyProperty as String
      Get
        Return Me._name
      End Get
      Set(ByVal as String)
        Me._name = Value
      End Set
    End Property
  End Class

After attaching:
[VB.Net]

Imports NineRays.Obfuscator

Namespace MyNamespace
  [NotObfuscate]'exlude this class from obfuscation (but not its members)
  Public Class MyClass
    Inherits Object
    Private _name As String
    [NotObfuscate]'exclude this property from obfuscation
    Public Property MyProperty as String
      Get
        Return Me._name
      End Get
      Set(ByVal as String)
        Me._name = Value
      End Set
    End Property
  End Class


4. You can find the .vb source of obfuscation attributes in the same with  NineRays.ObfuscationAttributes.dll assembly folder for detailed info.
5. There is not necessary to distribute NineRays.ObfuscationAttributes.dll with your app, as this assembly uses only for marking members purposes and doesn't affects functionality of your application.