When would using Assembly.LoadFrom or Assembly.LoadFile be appropriate?
Main difference is that LoadFrom
can be redirected to another assembly at a different path but with same identity if it's already loaded. LoadFile
just loads exactly what the caller requested.
So, you should use LoadFrom
when you need to prevent loading second assembly with same identity or just loading assembly twice.
Respectively, you should use LoadFile
only if you need to load assembly twice or load two assemblies with same identifier.
You can read more in this article LoadFile vs LoadFrom.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With