I have a partial assembly name, e.g., "PresentationUI"
. How can I resolve and load this partial assembly name into the reflection-only context.
// THIS GETS AN EXCEPTION
Assembly.ReflectionOnlyLoad("PresentationUI");
// THIS GETS AN EXCEPTION (AND IS NOT REFLECTION-ONLY)
Assembly.Load("PresentationUI");
// THIS WORKS (BUT IS OBSOLETE AND IS NOT REFLECTION-ONLY)
Assembly.LoadWithPartialName("PresentationUI");
The exceptions mentioned above are the same in either case:
FileNotFoundException: Could not load file or assembly 'PresentationUI' or one of its dependencies. The system cannot find the file specified.
I have tried using AppDomain.CurrentDomain.ApplyPolicy()
in an attempt to resolve the partial assembly name to a full assembly name, but no luck.
// THIS RETURNS "PresentationUI"
AppDomain.CurrentDomain.ApplyPolicy("PresentationUI");