Red Gate forums :: View topic - Error while Obfuscation
Return to www.red-gate.com RSS Feed Available

Search  | Usergroups |  Profile |  Messages |  Log in  Register 
Go to product documentation
SmartAssembly 6
SmartAssembly 6 forum

Error while Obfuscation

Search in SmartAssembly 6 forum
Post new topic   Reply to topic
Jump to:  
Author Message
winman



Joined: 01 Apr 2013
Posts: 6

PostPosted: Mon Apr 01, 2013 3:10 pm    Post subject: Error while Obfuscation Reply with quote

We have developed project using vb.net for our internal puproses and then we obfuscated it. It is throwing error as mentioned below.
“Public member ‘Var1’ on type ‘e’ not found.”
Code:
Code:

Public Sub get_constants_from_DbList(ByRef frm As Object, ByRef sDbname As String)

        For Each Row As DataRow In CommonObj.DSCommonProc.Tables("dblist").Rows
               If StrComp(Row("DbName").ToString, sDbname, CompareMethod.Text) = 0 Then
                   prg_id = Row("PrgId").ToString
                   frm.Var1= Row("ChangesDbName").ToString
                  frm.Var2 = Row("LoadTableName").ToString
                  frm.Var3 = Row("ServerName").ToString
                  Exit Sub
            End If
        Next

 End Sub

A form (named FrmMain) is passed to the parameter ‘frm’ from the calling procedure to this sub-routine. Var1, etc are public variables in that form.
Obfuscation tools we tried are –
1. SmartAssembly 6
2. PreEmptive Dotfuscator and Analytics CE (which has come with Visual studio 2012)
Without obfuscation exe is working fine.
Error is thrown while assigning variable ‘Var1’ in the sub-routine. If the code line is modified as below then obfuscated exe will work fine.
FrmMain.Var1= Row("ChangesDbName").ToString

We thought obfuscation is missing late binding & tried similar type of code in a small sample project. But that didn’t have any error. We have attached this small code. But due to its magnitude we can’t upload original project.
How can we trace the error?
Back to top
View user's profile Send private message
Chris.Allen



Joined: 12 Mar 2009
Posts: 546

PostPosted: Tue Apr 02, 2013 4:32 pm    Post subject: Reply with quote

Are you using the merging function? This will destroy the namespaces internally
Back to top
View user's profile Send private message
winman



Joined: 01 Apr 2013
Posts: 6

PostPosted: Wed Apr 03, 2013 6:27 am    Post subject: Reply with quote

Hi chris..
what is merging function?
Back to top
View user's profile Send private message
Chris.Allen



Joined: 12 Mar 2009
Posts: 546

PostPosted: Wed Apr 03, 2013 5:21 pm    Post subject: Reply with quote

It's a function at the same level as obfuscation. It merges all your assemblies into one.

We can probably assume this is not the cause.

My next guess is that “FrmMain” is called by its name (Reflection). This can be the case even if you don’t explicitly use Reflection on your case (Remoting, Serilization, Data-binding,etc.)
You need to exclude it from obfuscation.

Please take a look at the following for help ion how to do this:

http://www.red-gate.com/supportcenter/content/SmartAssembly/help/6.7/SA_troubleshooting_build
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic All times are GMT + 1 Hour
Page 1 of 1

 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group