Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Trying to avoid AppDomains

I have a long running C# server application running on Linux/mono, and I have added the ability to load DLL assemblies on the fly to extend the application. I have discovered updating those DLL assemblies at runtime cant be done without using AppDomains, which by the looks of will just get in the way of what I have already done. Sure there will be workarounds, but that's not what I really want.

Does mono provide any alternative solutions that I might have missed? Does C# 4.0 have anything new in this area?

like image 387
FlappySocks Avatar asked Nov 14 '22 13:11

FlappySocks


1 Answers

Instead of loading in a new assembly to modify behavior, have you considered breaking up the application into distinct components, and communicating between them via a webservice or TCP/IP? That way you can change out the behavior of the application (at runtime) by changing where the components call. For example, you can build a new component with the new behavoir, webservice for example, and then instruct all the existing components to use it.

It'll also solve some memory issues with long running applications with the mono run-time.

like image 57
tgiphil Avatar answered Dec 16 '22 09:12

tgiphil