You're touching on what I know is the right way to do this but is not
possible in my scenario. What really needs to be done is to have
interfaces/abstract classes defined in one assembly and the main application
references only that assembly.
You can then use a plugin architecture to dynamically load the correct
assembly and create the instances behind the scenes.
The problem with my scenario is I want to shove code generated obects
(strong typed datasets) into their own assemblies and there is no way it is
productive to create base interfaces for the code-generated objects.
Especially since they change so much.
This kind of stinks but it just blows this approach out of the water for
dealing with provider generic code.
What I'm really trying to do is come up with a way to get around all the
deficienices of using strong typed datasets and table adapters while trying
to talk with two different databases. It wouldn't have been ideal but it
would have been a start to just have two different kits one for Oracle
support and one for SQL Server.
The old Visual Studios (prior to .NET) also had a way to say that even a
certain file in the project should or should not be built for a particular
build configuration. This might have worked as well.
"Marina" wrote:
Well, it would help you if you wanted to code the entire thing using
reflection. Which I don't think you do.
I guess you could use reflection to create the objects, then cast them to
the appropriate interface/base class type, and reference them through that
as opposed to the actual class name.
Other then that, you just have to include all the references required for
compile.
"Oldman" <Ol****@discussions.microsoft.com> wrote in message
news:B5**********************************@microsof t.com... Thanks for your response. So your saying that there isn't a way to do
this.
The problem is dynamically loading the assemblies won't help me because
the
source wouldn't compile unless one of the two assemblies was referenced.
"Peter Rilling" wrote:
You will probably have to dynamically load the assemblies.
"Oldman" <Ol****@discussions.microsoft.com> wrote in message
news:4C**********************************@microsof t.com...
> How do you conditionally reference an assembly based off of the build
> configuration? Imagine a scenario where I want to have an Sql Release
> Server
> build and an Oracle Release Build and the only difference between them
> is
> a
> reference to a different assembly.
>
> Is it possible to do this in VS2005?