Auto Dependency Injection Discovery and ClickOnce security exception

Posts   
 
    
pat
User
Posts: 215
Joined: 02-Mar-2006
# Posted on: 11-Jan-2010 03:05:15   

I have got exactly the same issues as this one: http://www.llblgen.com/TinyForum/Messages.aspx?ThreadID=13376&HighLight=1

With auto discovery on and click once deployment enabled I get the attached security exception. With auto discovery off and explicitly identifying the assemblies that participate in dependency injection it works without security exception.

Thanks, Patrick

Attachments
Filename File size Added on Approval
StackTrace.txt 17,114 11-Jan-2010 03:05.42 Approved
Walaa avatar
Walaa
Support Team
Posts: 14946
Joined: 21-Aug-2005
# Posted on: 11-Jan-2010 10:26:33   

Do you have a problem working without auto discovery?

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39590
Joined: 17-Aug-2003
# Posted on: 11-Jan-2010 11:23:40   

Auto-discovery uses reflection on all assemblies found in-scope. This might be a problem if the assembly is for example obfuscated or not 'reflectable' (is that a word? wink ).

If auto-discovery gives problems like these (and the auto-discovery process can only know if an assembly has injectables if it has analyzed it so this exception is unavoidable in some situations), you've to specify the assemblies manually. there's nothing wrong with specifying them, as it's also in general faster.

Frans Bouma | Lead developer LLBLGen Pro
pat
User
Posts: 215
Joined: 02-Mar-2006
# Posted on: 13-Jan-2010 00:48:57   

Otis wrote:

If auto-discovery gives problems like these (and the auto-discovery process can only know if an assembly has injectables if it has analyzed it so this exception is unavoidable in some situations), you've to specify the assemblies manually. there's nothing wrong with specifying them, as it's also in general faster.

I had been using auto discovery for a while without any problems when they suddenly started... so it took me an hour of testing around and finally searching to find the post which mentioned to specify the assembly directly. Might be nice for other users in the future to mention in the LLBLGen documentation that auto discovery can lead to security exception and that specifying the assembly fixes it.

Thanks, Patrick

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39590
Joined: 17-Aug-2003
# Posted on: 18-Jan-2010 17:47:47   

Good idea, will add that to the docs simple_smile

(edit) added in next build.

Frans Bouma | Lead developer LLBLGen Pro