T
Thomas W. Brown
I need to dynamically addref a system assembly at runtime (for dynamically
generated code), but Assembly.Load is failing (I'm just specifying the
assembly name but no other components of the full name).
In particular,
Assembly.Load("System.Runtime.Remoting")
fails for me with an "Could not load file or assembly
'System.Runtime.Remoting' or one of its dependencies. The system cannot find
the file specified." error.
I suspect this is because, according to the Assembly.Load documentation,
"You can also make a dynamic reference to an assembly by providing the
calling method with only partial information about the assembly, such as
specifying only the assembly name. In this case, only the application
directory is searched for the assembly, and no other checking occurs. You
make a partial reference using any of the various methods for loading
assemblies such as System.Reflection.Assembly.Load or System.AppDomain.Load."
So, I need the long name of the assembly in order to load from the GAC.
Which brings me to the operative question...
What is the best (easiest) way to determine the proper long name for an
assembly in the GAC so that I can dynamically load said assembly?
Regards,
-- TB
generated code), but Assembly.Load is failing (I'm just specifying the
assembly name but no other components of the full name).
In particular,
Assembly.Load("System.Runtime.Remoting")
fails for me with an "Could not load file or assembly
'System.Runtime.Remoting' or one of its dependencies. The system cannot find
the file specified." error.
I suspect this is because, according to the Assembly.Load documentation,
"You can also make a dynamic reference to an assembly by providing the
calling method with only partial information about the assembly, such as
specifying only the assembly name. In this case, only the application
directory is searched for the assembly, and no other checking occurs. You
make a partial reference using any of the various methods for loading
assemblies such as System.Reflection.Assembly.Load or System.AppDomain.Load."
So, I need the long name of the assembly in order to load from the GAC.
Which brings me to the operative question...
What is the best (easiest) way to determine the proper long name for an
assembly in the GAC so that I can dynamically load said assembly?
Regards,
-- TB