I am wondering if it is possible to load an Assembly into an AppDomain using only the namespace string, for example System.Data.Odbc
(without the rest of the fully qualified Assembly name)
I also cannot load the assembly using the path to the DLL, I need .NET to resolve this for me.
Background:
I have a C# script compiler running in another AppDomain, these scripts can contain references such as: System.Data.Odbc.OdbcConnection conn
and I need to load types the script references.
I am parsing out System.Data.Odbc.OdbcConnection
and loading System.Data.Odbc
. I expect the loading of System.Data.Odbc.OdbcConnection
to fail, and my code accounts for this, but I need to know if it's possible to load an assembly ONLY using the string System.Data.Odbc
I reviewed this question:
Can I load a .NET assembly at runtime and instantiate a type knowing only the name?
However it does not help me, since it assumes knowledge of the dll file name.
It is safe to assume for this question that the libraries are located in the GAC or the app's base directory.
System.Linq
is mostly implemented in `System.Core.dll. Now, are you really talking about assembly names without version numbers, or about namespaces? – Jon SkeetSystem.Data.Odbc
when I only have the stringSystem.Data.Odbc
– dmck