Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 415549
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T18:23:32+00:00 2026-05-12T18:23:32+00:00

Env.: VS2008 C# project I need to build my app for use in 2

  • 0

Env.: VS2008 C# project

I need to build my app for use in 2 different environments. In one of those environments, I need to use a 3rd party DLL assembly.

I could isolate the code that uses this DLL using #if blocks. But how do I conditionally include the reference to the DLL in the CS project file?

Edit: womp has a good point in his comment. I turned into a separate question: Will the referenced DLL be loaded at all if it’s never called?
TIA,

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-12T18:23:32+00:00Added an answer on May 12, 2026 at 6:23 pm

    Unload the project and open it as .XML

    Locate the reference item tag and add a Condition attribute.

    For instance:

    <ItemGroup>
      <Reference Include="System.Core">
        <RequiredTargetFramework>3.5</RequiredTargetFramework>
      </Reference>
      <Reference Include="System.Data" />
      <Reference Include="System.Drawing" />
      <Reference Include="System.Xml" />
    
      <Reference Include="MyUtilities.Debug"
        Condition="'$(Configuration)'=='Debug'"/>
    
    </ItemGroup>
    

    Notice the last reference now has a condition.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Env.: .NET / VS2008 Hi All, My app uses a 3rd party DLL assembly
Env.: VS 2008, .NET 2.0, WinForms I have a listview in Tile mode. Some
Env.: Vista SP1, SQL Server Express 2005 I'm able to connect to my localhost
We are developing an extension (in C# .NET env.) for a GIS application, which
The following test fails: #!/usr/bin/env python def f(*args): >>> t = 1, -1 >>>
I'm trying to create a debug build with a corresponding debug installer for our
I have a C application that I've created in VS2008. I am creating a
I've got a fairly large MFC application that has just been migrated from VS6.0
Could someone chime in as to whats a better practice? for select queries should
I'm calling a WebService exposed by Oracle that accepts an input of an ItemID

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.