问题
I've written a batch execution framework and in it I want (in some scenarios) to load an assembly from the GAC where there may be multiple versions but I just want to load the latest version.
Is this even possible?
TIA
回答1:
Assembly.LoadWithPartialName(string)
will do exactly what you want.
回答2:
You should be able to use a publisher policy with a BindingRedirect. See this SO answer.
回答3:
Linq to Gac can query the GAC. You can load assembly at runtime once you know what you want.
来源:https://stackoverflow.com/questions/283419/how-to-just-load-the-latest-version-of-dll-from-gac