|
Hi there. I'm writting an XBAP application. I have to figure out a deployment stratage for the following setup. I would appreciate if you can guide me how I can do this. The requirement I have is that the application I'm writing needs to load dll modules on demand. The reason is because, there are many dlls(user created module) and to publish full set of dlls whenever there are changes are not an option since it can change quite frequently and anyone can publish new dlls. The application is more like a shell and functions are extended by dll modules. I've seen only application deployment ClickOnce examples but not dll deployments. The question I have are two parts 1. When the application starts, it only knows the name of dll to load and the server URL where dlls are published. It needs to check to see if new dll is available, and download if necessary. How can this be done? I guess I need to know if new dll is available on the server and download to KNOWN folder so that it can be loaded from the application. 2. In order #1 to happen, the first thing I need is to publish dll using ClickOnce, but there is no "publish" option for dll project. How can I publish dll library? User can create this dll project and publish it to known URL and later to be downloaded on demands by shell application from #1. I appreciate for your help greatly. -Chris
| | chrisk414 Wednesday, August 26, 2009 5:06 PM | chrisk414, If you'd like to be sneaky, there's another way. Write a windows forms application and include your dll with build action = "content" and copy-to-output-directory = "copy always". Your windows form should just copy the dll from the local directory to somewhere your application can pick it up, preferably LocalApplicationData. You can even make the form's visible property = false, although it should happen so fast, the user will never see it anyway. So the winforms app basically just copies the dll at startup and then closes itself down. Something like this: string sourceFile = Path.Combine(System.Windows.Forms.Application.StartupPath, "mynewdll.dll"); string destFolder = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData), "MyAppName"); if (!Directory.Exists(destFolder)) Directory.Create(destFolder); File.Copy(sourceFile, Path.Combine(destFolder, "mynewdll.dll")); Now deploy this using ClickOnce. You can have the user run the installation to "install" the dll, or you can even have your other ClickOnce application install it by doing something like: process.start("iexplore.exe",http://myserver.myco.com/mydll/mydll.application"); And your original ClickOnce application knows where it is, because you are copying it to a specific location. And if you later want to do an upgrade, you can have the "host application" run the process.start on the application file and it will pick up any upgrades you have deployed to the win-form-dll-application. RoibnDotNet Click here to visit my ClickOnce blog!- Marked As Answer bychrisk414 Sunday, September 06, 2009 3:34 PM
-
| | RobinDotNet Monday, August 31, 2009 2:50 AM | Hello Chris, Thanks for your post on MSDN forum. Based on my understanding on your post, you want to deploy the library on demend. Please correct me if there is any misunderstanding. Please take a look at the following walkthrough, the walkthrough demonstrates how to mark certain assemblies in your application as "optional", and how to download them by using classes in the System.Deployment.Application namespace when the common language runtime demands them. Walkthrough: Downloading Assemblies on Demand with the ClickOnce Deployment API Using the Designer http://msdn.microsoft.com/en-us/library/ak58kz04.aspx Thanks, Rong-Chun Zhang MSDN Subscriber Support in Forum If you have any feedback on our support, please contact msdnmg@microsoft.com
Please remember to mark the replies as answers if they help and unmark them if they provide no help.
Welcome to the All-In-One Code Framework! If you have any feedback, please tell us. | | Rong-Chun Zhang Thursday, August 27, 2009 9:02 AM | Hmm.. thanks for your post but I'm trying to solve a different problem. The assembly does not exist when I publish the application. For example, ModuleXYZ.dll does not exist when I publish the application, But later a user publishes ModuleXYZ.dll to a server and let me know there is module named ModuleXYZ.dll and the location. When I want to execute this module, I need to download this into a KNOWN folder so that I can load it into the app. My questions are, 1. How user can publish JUST a dll module using ClickOnce? There is no "publish" option under dll project. Perhaps I can make a wrapper application project around this dll. 2. How can the app check to see if new version of user created dll module is available using ClickOnce API, given just the name and the location of the module on a server? 3. And how can I download this module into the KNOWN folder on demand using ClickOnce? It seems like ClickOne download to some cache area and we have no control over where things are downloaded. I'm hoping this is a common usage case and ClickOnce supports it, otherwise, I'll have to write custom deployment utility. Thanks.
| | chrisk414 Thursday, August 27, 2009 1:50 PM | Hello Chris, Thanks for your feedback. Now I think I understand your problem. You want to deploy the Module dlls in an individual ClickOnce deployment. Feel free to correct me if I misunderstand the issue. Based on my understanding, we cannot publish an dll with ClickOnce, since the <entryPoint> Element is required in the Application Manifest. Another reason that we can not deploy the module dlls with ClickOnce is that ClickOnce application is installed on the ClickOnce application cache and we cannot change the location, each version has its own folder, hence your application might not know where to load the new module dll. http://msdn.microsoft.com/en-us/library/8s77x3h4.aspx My suggestion for requirement is that we can let the application itself to manage the downloading of module dlls. We can put the module dlls into a known place(e.g. a shared folder), when the application gets started from the client machine, check if there is a new module, if there is, copy the module to local machine and load the local image. Thanks, Rong-Chun Zhang MSDN Subscriber Support in Forum If you have any feedback on our support, please contact msdnmg@microsoft.com
Please remember to mark the replies as answers if they help and unmark them if they provide no help.
Welcome to the All-In-One Code Framework! If you have any feedback, please tell us. | | Rong-Chun Zhang Friday, August 28, 2009 9:39 AM | Thanks Rong I played with ClickOnce some more and I apprived at the same conclusion. ClickOnce is not designed for this. In short, it's for simple application deployment. But I wonder if my case is special.. hmm. I just came across things called "add-in" (http://msdn.microsoft.com/en-us/library/bb384241.aspx) and I wonder how it can help me. It looks pretty complicated(usually msdn's explanation is very convoluted) and I don't know if it's an overkill for my requirement, or it's not really related to deployment. Let me know if you have some suggestions about "add-in" or others that I don't know. Cheers. | | chrisk414 Friday, August 28, 2009 2:00 PM | chrisk414, If you'd like to be sneaky, there's another way. Write a windows forms application and include your dll with build action = "content" and copy-to-output-directory = "copy always". Your windows form should just copy the dll from the local directory to somewhere your application can pick it up, preferably LocalApplicationData. You can even make the form's visible property = false, although it should happen so fast, the user will never see it anyway. So the winforms app basically just copies the dll at startup and then closes itself down. Something like this: string sourceFile = Path.Combine(System.Windows.Forms.Application.StartupPath, "mynewdll.dll"); string destFolder = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData), "MyAppName"); if (!Directory.Exists(destFolder)) Directory.Create(destFolder); File.Copy(sourceFile, Path.Combine(destFolder, "mynewdll.dll")); Now deploy this using ClickOnce. You can have the user run the installation to "install" the dll, or you can even have your other ClickOnce application install it by doing something like: process.start("iexplore.exe",http://myserver.myco.com/mydll/mydll.application"); And your original ClickOnce application knows where it is, because you are copying it to a specific location. And if you later want to do an upgrade, you can have the "host application" run the process.start on the application file and it will pick up any upgrades you have deployed to the win-form-dll-application. RoibnDotNet Click here to visit my ClickOnce blog!- Marked As Answer bychrisk414 Sunday, September 06, 2009 3:34 PM
-
| | RobinDotNet Monday, August 31, 2009 2:50 AM | Hello Chris,
Have you got any progress on this issue? If there is anything else we can help, welcome to post here.
If the issue is resolved, we will appreciate it if you can share the solution so that the answer can be found and used by other community members having similar questions.
Thanks, Rong-Chun Zhang
Please remember to mark the replies as answers if they help and unmark them if they provide no help.
Welcome to the All-In-One Code Framework! If you have any feedback, please tell us. | | Rong-Chun Zhang Friday, September 04, 2009 8:52 AM | I decided to implement my own custom versioning system for the user uploaded dlls. ClickOnce doesn't solve my problem but I hope it does in the future. Thanks for all your help.
| | chrisk414 Sunday, September 06, 2009 3:36 PM |
|