How can we help you today? How can we help you today?

Issues when using reflection and Obfuscation

I am using reflection in my classes to report the classname and method name when an error occurs:
Try
            Dim i As Integer = 0
            Dim s As String = "wibble"
            i = CInt(s)
        Catch ex As Exception
            ThrowExceptionEx(My.Application.Info.AssemblyName, MethodBase.GetCurrentMethod.DeclaringType.Name, MethodBase.GetCurrentMethod().Name, ex)
        End Try
    End Sub

But when I obfuscate the code the
MethodBase.GetCurrentMethod.DeclaringType.Name
and
MethodBase.GetCurrentMethod().Name
get mangled. How can I stop obfuscation just on these items?
mattwilkinson
0

Comments

1 comment

Add comment

Please sign in to leave a comment.