Red Gate forums :: View topic - Type is marked as eligible but is not marked as public.
Return to www.red-gate.com RSS Feed Available

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

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

Search in SmartAssembly 5 forum
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.
Jump to:  
Author Message
Lulzy



Joined: 16 Nov 2010
Posts: 3

PostPosted: Tue Nov 16, 2010 5:11 am    Post subject: Type is marked as eligible but is not marked as public. Reply with quote

Stack trace:
Code:
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.
Back to top
View user's profile Send private message
Chris.Allen



Joined: 12 Mar 2009
Posts: 594

PostPosted: Wed Nov 17, 2010 2:45 pm    Post subject: Reply with quote

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 ....
Back to top
View user's profile Send private message
Lulzy



Joined: 16 Nov 2010
Posts: 3

PostPosted: Thu Nov 18, 2010 7:05 am    Post subject: Reply with quote

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.
Back to top
View user's profile Send private message
Chris.Allen



Joined: 12 Mar 2009
Posts: 594

PostPosted: Fri Nov 19, 2010 3:43 pm    Post subject: Reply with quote

the head scratching commences...
Back to top
View user's profile Send private message
Chris.Allen



Joined: 12 Mar 2009
Posts: 594

PostPosted: Fri Nov 19, 2010 3:48 pm    Post subject: Reply with quote

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.
Back to top
View user's profile Send private message
Lulzy



Joined: 16 Nov 2010
Posts: 3

PostPosted: Sun Nov 21, 2010 7:41 am    Post subject: Reply with quote

Alright, I tried that and my program works fine if I don't have code obfuscation on..
Back to top
View user's profile Send private message
Chris.Allen



Joined: 12 Mar 2009
Posts: 594

PostPosted: Mon Nov 22, 2010 3:52 pm    Post subject: Reply with quote

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.
Back to top
View user's profile Send private message
Display posts from previous:   
This topic is locked: you cannot edit posts or make replies. 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