0

What's the point of dynamically loading an assembly? Isn't it just way simpler to just reference it in your solution/project, saving you all the calls to Assembly.*Load* functions?

Update: Is it useful outside of plugins? What about exclusively in web development, what uses would I find there for dynamically loading an assembly?

3 Answers 3

4

Dynamically loading an assembly is useful for anything requiring execution of external code that might not even exist when the hosting program is developed.

For instance, any plug-in system will have to use that feature.

Sign up to request clarification or add additional context in comments.

1 Comment

Dynamically loading assemblies also allows the use of AppDomains, which allow you to restrict the permissions granted to the assembly by placing it in a more restrictive zone.
1

What if you want to make it possible to write plugins for your application, which get loaded at runtime and you don't have that project at compiletime?

Comments

1

You may not have that assembly when you compile your code, think of plugins for instance. You can't compile with a reference to them. Other reason is generating and compiling code and then loadin that Advanced stuff but real use.

GJ

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.