ClickOnce and plugin directories  
Author Message
Norman37050





PostPosted: ClickOnce and Setup & Deployment Projects, ClickOnce and plugin directories Top

Hi,

I was wondering if it's possible to configure ClickOnce such that subdirectories containing other assemblies (such as plugins) are created in the cache. At present, I have a directory containing a number of plugins and because in the ClickOnce cache all assemblies seem to be thrown together in one directory, the app doesn't work. It tries to look for the plugins in a "plugins" subdirectory and it doesn't find it since it doesn't exist. Is there a way to specify the directory structure in either the deployment or application manifests

Thanks in advance for any assistance anyone might be able to provide.

Norman


Windows Forms12  
 
 
BrianNoyes





PostPosted: ClickOnce and Setup & Deployment Projects, ClickOnce and plugin directories Top

You can definitely do this. Just create subfolders as part of your Visual Studio project and put your plugin DLLs there, and they will be deployed to subfolders on the client machine with the same relative path under the root application directory. I have coverage of this in my upcoming book Smart Client Deployment with ClickOnce. It should be up on Safari Rough Cuts in a couple months. You can download a code sample demonstrating this from this URL:

http://www.softinsight.com/downloads/ImageProcessingPlugInApp.zip

Brian Noyes
IDesign
Microsoft Regional Director, MVP



 
 
Norman





PostPosted: ClickOnce and Setup & Deployment Projects, ClickOnce and plugin directories Top

Hi Brian,

Thank you very much for that. Very helpful, esp. the sample code. On a related note, would you happen to know how to do the same thing by handwriting the manifest files or by using mage.exe It'd be nice to be able to separate the specifics of the deployment from the actual VS project itself, since we may have different plugin configurations of the same app. It would also help make an automated build/update process easier.

Norman

 
 
BrianNoyes





PostPosted: ClickOnce and Setup & Deployment Projects, ClickOnce and plugin directories Top

Mage does not give you a lot of flexibility in where you place your files. You would have to write a custom tool that works against the classes in the Microsoft.Build.Tasks.Deployment.ManifestUtilities namespace to do something custom. I'm going to be developing a tool in the near future to help deal with this, but haven't had time yet.

 
 
Norman





PostPosted: ClickOnce and Setup & Deployment Projects, ClickOnce and plugin directories Top

Hope you don't mind if I follow up with another question, this time related to security. Upon startup, my app creates a secondary AppDomain into which a bunch of assemblies are loaded from a plugin directory so as to determine whether they are in fact plugins or not (some of the assemblies may just be references that a plugin depends on but are not plugins themselves). When a list of plugins has been compiled, the AppDomain is unloaded and the actual plugins are then loaded into the primary AppDomain. Pretty standard stuff. Everything works fine in normal circumstances. However, when I try to install and run the app via ClickOnce, it becomes unhappy and throws a SecurityException. The exception details indicate that it's asking for FileIOPermission but was refused. The App is configured as ClickOnce with full trust.

I'm pretty green with respect to security related matters. Any ideas on how to get this to work Do I have to create the AppDomain with a different set of permissions or something

(BTW, I look forward to your book...I think I'm going to need it! :) )

Norman

 
 
BrianNoyes





PostPosted: ClickOnce and Setup & Deployment Projects, ClickOnce and plugin directories Top

Hi Norman,

I had one of the security experts from the product team look at your post and he concluded same thing I did - there is not enough information here to conclude what is going on. He suggested you read this article that might help out:

http://msdn.microsoft.com/msdnmag/issues/05/11/HostingAddIns/default.aspx

If you want to contact me for more detailed follow up, send me some more information at brian.noyesATidesign.net.

Thanks

Brian



 
 
Norman





PostPosted: ClickOnce and Setup & Deployment Projects, ClickOnce and plugin directories Top

Hi Brian,

Thanks for the link to that article...very helpful! I basically had to create the AppDomain with the appropriate permissions. Thanks again!

Norman