Question

I develop client application that invokes product that has multiple versions and my customers can load different versions of the product one after another.

In order to support that in previous versions I created Application domain for each time user picked version.

Is it the right way to do it ? Do I have alternative ?

EDITED: Multiple versions - multiple dlls

Thank You!

Was it helpful?

Solution

If different versions of products reside in different DLLs, then yes, AppDomain is the right way to do it.

Although make sure you don't leak the DLLs to your main domain.

Also, run some tests to make sure you don't leak memory.

UPDATE

Alternative is to load the DLLs in another process and use RPC or service calls. I guess that's an overkill for your application.

OTHER TIPS

I don't think the products has to reside in different AppDomains. What is the main reason for doing it that way? Do you want your app to be able to unload particular dll, and load a new version of the same dll while running? If not... I don't see what is the reason behind having App Domains.

AppDomains are usually used when you want to guarantee that memory allocated by assembly itself could be freed when assembly is unloaded. It makes sens in some types of apps. IIS uses AppDomains to manage all applications it is running (so that applications are separated).

Why not use a common interface for all versions of the product, and store information about the product itself inside (propert or whatever way you like)?

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top