Reference per configuration

  • Thread starter Thread starter Boris
  • Start date Start date
B

Boris

I encountered a problem, I can't define reference for a specific
configuration.
My project, like any other, has 2 configurations ("Debug" and "Release") In
the "Debug" configuration I use Nunit for testing, so all nunit related code
is under #if NTEST definition. The NTEST declared only in Debug
configuration. However, in order to use NUnit I have to add reference for
nunit.framework.dll. My problem is that I don't want to add this reference
in the release configuration. I don't want to put the dll to the client
machine. Do you know how can I define a reference for a specific
configuration? I think that reflection could help, but I'm not quite sure
how to do it. Please give me an advise if you know.
 
Hi,

I depends on the language you are using. If you are using Managed C++, you
can use the standard #if to seperate the code.
When using C# and VB.NET, the references are set in both debug and release.

A way to get around this is to use late binding, look up the Activator
class, it allows you to create an instance of a class at runtime.
The disadvantage is that you don't get Intellisense when using this method.

Chris
 
still another way is to use MSMQ which comes with connection redundancy
built in
 
Back
Top