Red Gate forums :: View topic - Reflection
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

Reflection

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
kchristo



Joined: 25 Jan 2011
Posts: 3

PostPosted: Tue Jan 25, 2011 11:43 am    Post subject: Reflection Reply with quote

Hi, I am rather new in using smartassembly.
I have an issue with reflection. It's general but I will try to specialize.

There is a type let it be TypeA in assembly AssemblyA which is merged to the main executable assembly. No obfuscation, no pruning, no nothing. Just merged.

There is a point in my code where I call:

type.GetCustomAttributes(...) where type == typeof(TypeA) which means TypeA is already known to the runtime and AssemblyA already loaded. At least it should be.

But I get an exception saying that AssemblyA could not be loaded (or one of the dependencies, which by the way are all in place).

From these I gather that GetCustomAttributes somehow tries to re-load AssemblyA from a file.

Can you shed any light on my drama? Wink
Back to top
View user's profile Send private message
Brian Donahue



Joined: 23 Aug 2004
Posts: 6678

PostPosted: Tue Jan 25, 2011 2:14 pm    Post subject: Reply with quote

Hi,

SmartAssembly merging can cause problems with type equivilence, according to Alex. There is a blurb about that elsewhere on the forum but not further information or fix action. I think you just have to try embedding instead.
Back to top
View user's profile Send private message
kchristo



Joined: 25 Jan 2011
Posts: 3

PostPosted: Tue Jan 25, 2011 2:19 pm    Post subject: Thanks Reply with quote

Thanks for the reply. I will try this and inform you about the results
Back to top
View user's profile Send private message
kchristo



Joined: 25 Jan 2011
Posts: 3

PostPosted: Tue Jan 25, 2011 2:26 pm    Post subject: Partial success Reply with quote

This did work actually. I have another issue now which I will have to solve on my own. I already have implemented a solution of 10 smartassembly projects to protect projects that could not be merged or embeded to the main executable assembly, at least not without unwanted re-engineering. What I am trying to do now is somehow manage to have less files distributed. But embedding (even if a solve other issues) does not provide for obfuscation and the more I look into my situation the more I believe I will have to compromise with the 10 projects approach. Crying or Very sad
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