Claudio Lassala

Hi all,

I've got a problem here that I don't know how to fix it.

I have a clickonce-deployed app that. There's a feature in the app that uses reflection to analyze types in an assembly. ClickOnce security is set to FullTrust.

Everything works fine, except that the assemblies loaded by the app remain locked until I shut down the app. To fix that problem, I've created another appDomain within the app and moved the logic that loads the assembly to that sub-domain so that I can unload programmatically. Now the app doesn't work any more. Whenever it tries to execute the line that load the assembly through reflection, I get the following exception:

Request for the permission of type 'System.Security.Permissions.FileIOPermission, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed.

If I turn off ClickOnce Security, it all works again, but of course this is not an option since that setting turns back on when I publish the app.

Any ideas I've tried programmatically grant permissions to that sub-appdomain that I create, but it doesn't work either. I don't understand how it works fine when I run the logic from the main appDomain, though...

Any help is highly appreciated.

Claudio Lassala