K
Kevin Frey
Is it possible to get c# perform a using statement where the namespace for
the using is not specified literally but instead comes from a variable, a
token, a predefined value etc.
We have numerous auto-generated assemblies that represent specific database
models within a database, but each assembly uses commonly-named base classes
with common implementations. I am writing code that deals only with the base
classes, hence it *could* be usable with any of these assemblies, but I need
a specific "using" directive to nominate a particular namespace in order to
access the base classes.
However, because our auto-generated assemblies are intended for customer
deployment, we have not tried to "break out" the base classes into a common
assembly or even a common namespace, because if the customer ever needs to
use two of our assemblies simultaneously, there might be two different
versions of the base classes involved (depending on the relative ages of the
assemblies).
the using is not specified literally but instead comes from a variable, a
token, a predefined value etc.
We have numerous auto-generated assemblies that represent specific database
models within a database, but each assembly uses commonly-named base classes
with common implementations. I am writing code that deals only with the base
classes, hence it *could* be usable with any of these assemblies, but I need
a specific "using" directive to nominate a particular namespace in order to
access the base classes.
However, because our auto-generated assemblies are intended for customer
deployment, we have not tried to "break out" the base classes into a common
assembly or even a common namespace, because if the customer ever needs to
use two of our assemblies simultaneously, there might be two different
versions of the base classes involved (depending on the relative ages of the
assemblies).