Type is marked as eligible but is not marked as public.

.NET obfuscator and automated error reporting

Moderators: Luke Jefferson, Alex.Davies, melvyn.harbour

Type is marked as eligible but is not marked as public.

Postby Lulzy » Tue Nov 16, 2010 5:11 am

Stack trace:
Code: Select all
System.TypeLoadException
Could not load type '.„' from assembly 'MyAssembly, Version=1.0.0.0, Culture=neutral, PublicKeyToken=37ff7609970e6758'. The type is marked as eligible for type equivalence, but it is not marked as public.

at ..™(Object , EventArgs )
at System.Windows.Forms.Timer.OnTick(EventArgs e)
at System.Windows.Forms.Timer.TimerNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)



This always happened before a certain timer is enabled. (from another timer in the same form)
First timer is to wait before execution of next timer, in other words not much stuff here. Second timer (to-be-executed from first) loads stuff from a HTML webpage.

I have tested the program before SmartAssembly-ing it, it works fine.


Help please? I'm using trial version by the way.
Lulzy
 
Posts: 3
Joined: Tue Nov 16, 2010 5:04 am

Postby Chris.Allen » Wed Nov 17, 2010 2:45 pm

Are you using the InternalsVisibleTo("...") attribute at all? If so, you have to be careful when obfuscating since this will potentially break the app. The solution will be to exclude the methods that have been marked with this attribute (you should have got a warning about this upon building in smartassembly (in yellow, italic font)).

If not, I'll need to scratch my head a bit more ....
Chris.Allen
 
Posts: 594
Joined: Thu Mar 12, 2009 4:17 pm

Postby Lulzy » Thu Nov 18, 2010 7:05 am

Hi, thanks for your reply.

Nope, I'm not using InternalsVisibleTo() at all. And I do have a warning after building it but in orange italic font.

At least one dependency does not have a strong name. As your assembly has been signed with a strong name, it may fail to load this dependency.

None of my embedded dependencies load at the point of time when the error occur.
Lulzy
 
Posts: 3
Joined: Tue Nov 16, 2010 5:04 am

Postby Chris.Allen » Fri Nov 19, 2010 3:43 pm

the head scratching commences...
Chris.Allen
 
Posts: 594
Joined: Thu Mar 12, 2009 4:17 pm

Postby Chris.Allen » Fri Nov 19, 2010 3:48 pm

We're going to have to trouble-shoot this process the long way- take off the smartassembly features, one-by-one, until the application works as usual. Then try to isolate the exact feature that causes the issue. This will help us narrow down what is actually happening.
Chris.Allen
 
Posts: 594
Joined: Thu Mar 12, 2009 4:17 pm

Postby Lulzy » Sun Nov 21, 2010 7:41 am

Alright, I tried that and my program works fine if I don't have code obfuscation on..
Lulzy
 
Posts: 3
Joined: Tue Nov 16, 2010 5:04 am

Postby Chris.Allen » Mon Nov 22, 2010 3:52 pm

I have a feeling this is related to reflection then. Are any of the obfuscated methods being called by reflection? Are any of the obfuscated classes serializable? You'll need to exclude from obfuscation either of these.
Chris.Allen
 
Posts: 594
Joined: Thu Mar 12, 2009 4:17 pm


Return to SmartAssembly 5

Who is online

Users browsing this forum: No registered users and 0 guests