Caching type

I have a scenario like this:

I have an assembly with my business types and this assembly is loaded with runtime reflection (Assembly.LoadFile) in WCF using KnownTypesProvider, but this assembly can be changed (some developers add a new method or new property, even changing some functionality could be fixed) but with Assembly.LoadFile the assembly file is locked and I cannot replace that assembly.

Is there a structure for caching types? using assembly ver. or assembly modification date? or is there even a way to boot without blocking?

thanks!!!!!!!!

0


source to share


1 answer


You cannot swap an assembly while the application is running. Even if you use ReflectionOnlyLoad it blocks. I guess you can't unload the assembly either. The application needs to be restarted.

If automatic reloading of assemblies is important to you, you can try to put everything depending on this assembly in AppDomain and restart the application domain.



If you are using the GAC, you can install a different version of the assembly, redirect it, and restart your application.

+2


source







All Articles