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

  • SEARCH
  • Home
  • 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
In production env, we use an applet provided by a 3rd party vendor for
Env: Visual Studio 2008, Shared COM Excel Addin, RibbonX, I use Setup project created
#!/usr/bin/env perl use warnings; use strict; use Excel::Writer::XLSX; my $workbook = Excel::Writer::XLSX->new( 'perl.xlsx' );
!/usr/bin/env perl use warnings; use strict; my $text = 'hello ' x 30; printf
Env: .NET 1.1 I got into this situation. Where I need to give a
why cannot I use @env['REMOTE_ADDR'] outside a route in Sinatra? I want to have
My env: rvm ruby 1.9.2 , and I build ImageMagick 6.7.4-6 from source. When
ENV : postgresql-8.4 I'm trying to build a category tree . Basically I'm expecting
I have a Virtual env for my django project, but when I hit pip

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.