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 9210021
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T00:58:43+00:00 2026-06-18T00:58:43+00:00

I am working on various projects and I need some help but not if

  • 0

I am working on various projects and I need some help but not if this is possible.

What I have are various C# projects which I want to have a C# Library that all my projects can
use, lets call this library 1.

Library 1 can make use of another library. lets call this library 2.

All projects will always use library 1 but not all projects will use library 2 within library 1.

Therefore at the moment if I create a new C# project and include library 1, I then get an error saying that library 2 isn’t available. I don’t really want to import library 2 unless the main project actually requires it. Therefore is there a way to make it so library 1 can ignore the using directive if library 2 is not available.

Hope this make sense, thanks for any help you can provide.

  • 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-06-18T00:58:44+00:00Added an answer on June 18, 2026 at 12:58 am

    You should not do what you’re asking to do. If not all projects will need library 2, then you have two ways you should solve it:

    Option 1: Refactor your projects so that library 2 is only included
    when needed. If the executable project is the one that decides if
    library 2 is necessary, then that’s the project that should reference
    it (or not).

    Option 2: Just include library 2 all of the time. If the main executable doesn’t
    need it, so be it. But since library 1 references it, you’ll need it.

    I would suggest option 1. Just by asking this question, I think you have a dependency issue, and that’s what should be fixed. There might be some complex solution for hacking around this, but that’s not good for long-term maintainability.

    I would also suggest googling Stable Dependencies Principle.

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

Sidebar

Related Questions

We have various php projects developed on windows (xampp) that need to be deployed
Need a little help with this script. It's working but I'd love a way
I'm working on a site that pulls various public RSS feeds down. I want
I have been working on a project in scala, but I am getting some
My Case: I'm working on a system that will need to create various X12
Like most shops we've got a team of people working on various projects that
I have various interrelated projects in my Eclipse Helios workspace. Some projects use the
I am working on some image distortion project, Where I need to implement various
I'm working on a project that will require me to take various .vbproj and
I am working on a php project that needs to store information about various

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.