Matthew,

When the code in your Release configuration does not use any of the types
from a particular assembly A, then the resulting assembly will not include
any references to A.

For instance: I've a library project that makes uses of the types in the
assembly nunit.framework *only* in Debug configuration:

  #if DEBUG

  [TestFixture]
  public class My Tester { /* ... */ }

  #endif

When I compile defining the DEBUG symbol, the resulting assembly contains a
reference to nunit.framework in its manifest:

  .assembly extern nunit.framework
  {
    .publickeytoken = (96 D0 9A 1E B7 F4 4A 77 )
    .ver 2:0:6:0
  }

But when I compile without defining the DEBUG symbol, the reference does not
end up in the manifest.

HTH,

Stefan


>-----Original Message-----
>From: [EMAIL PROTECTED] 
>[mailto:[EMAIL PROTECTED] On Behalf Of Matthew
>Sent: Friday, July 11, 2003 4:53 PM
>To: [EMAIL PROTECTED]
>Subject: Add Declaritive Reference To Assembly
>
>
>Hi,
>
>I'm trying to include a reference to a particular assembly 
>when in debug mode, but not when in release mode. Here is an example:
>
>#If DEBUG Then
>
>'Add declaritive reference to assembly
>
>#End If
>
>Is there a way to do this (like the snippet above) without 
>having to manually add/remove the assembly in VStudio, or run 
>command line builds?
>
>Thanks!
>
>Matthew
>

Reply via email to