简体   繁体   中英

How to update deployed class library (DLL)?

Currently I have a C# solution that contains a class library, installer, and setup projects. The setup project generates an MSI to install my class library (dll), registered vsdrfCOM, that is referenced after installation by a third party application on the end users client. I do not have any control over the third party app. This all works as expected and my class library is referenced without issue and can be installed/re-installed via the deployed MSI.

Unfortunately, the issue I am trying to tackle is how to apply updates to the class library (dll) without expecting the end user to uninstall via the MSI, download a new MSI, and run it. Also, there are user state folders/files generated that I would like to maintain. Basically, just overwrite the class library (dll). What I initially was shooting for was on initialization of the library, hit a remote location, check version, and download a new dll if needed. Then inform the user they need to restart the third party application.

  1. Just downloading a new dll and paisting over the old one does not appear to work even if CLSID's are maintained as it appears the registry is not liking something. Inspired by the Auto Update project located here, http://www.codeproject.com/KB/vb/Auto_Update_Revisited.aspx

  2. ClickOnce does not seem to work with class libraries unless you have a Forms/Console application tied to it.

  3. Not sure if a new MSI can be downloaded and ran over the old passively without overwriting the user state files mentioned above.

So, is there a way to update a dll that has been installed with an MSI under the above conditions?

Thanks.

What if your class library is made up of two .dlls, let's say library A and library B.

Library A exposes the interface to the third-party app, but defers the actual logic to library B. Every time library A is loaded, it loads library B by first checking for a newer version online, and downloading it if available. Your MSI could theoretically only install library A, and count on library B to be downloaded at run-time. (Although it's probably a good idea to include both in case internet connectivity is down)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM