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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T15:06:44+00:00 2026-05-12T15:06:44+00:00

Env.: .NET / VS2008 Hi All, My app uses a 3rd party DLL assembly

  • 0

Env.: .NET / VS2008

Hi All,

My app uses a 3rd party DLL assembly separately installed on some systems (clearly identified) but not all of them.

Which means that on some systems, the DLL is not there hence must not be called. To solve this, I have 2 versions of the app (using 2 configurations) for the 2 use cases. In one of them, all calls to the DLL are #if’ed out.

Since there are no calls to the DLL compiled at all in the app(they’re #if’ed out), is it safe to assume that the app won’t try to load the DLL even though it is referenced?

Or should I also exclude the reference?

Note: Asked in reaction to womp’s comment in this question.

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-12T15:06:45+00:00Added an answer on May 12, 2026 at 3:06 pm

    IIRC, the C# compiler will omit references to dll’s that are never actually used in the code. So if all code is inside #ifs, the reference to the dll will not be there in your compiled app, and the dll will never be loaded.

    You can check this using Reflector, by the way. Just drag & drop your compiled app into Reflector, and look at the References node. ILDASM also provides this feature, I think.

    Caveat: DllImports and dynamic type loading (e.g., Type.GetType("type,dll")) will dynamically load dlls without the C# compiler knowing or caring. But again, if inside the proper #ifs, nothing will be loaded.

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

Sidebar

Related Questions

Env.: VS 2008, .NET 2.0, WinForms I have a listview in Tile mode. Some
We are developing an extension (in C# .NET env.) for a GIS application, which
Env: .NET 1.1 I got into this situation. Where I need to give a
I have the following script: #!/usr/bin/env ruby require 'rubygems' require 'net/ssh' Net::SSH.start('host1', 'root', :password
Having some problems installing BlogEngine.NET onto my CentOS mod_mono 2.8 (mono 2.8.1) box. The
Env.: Vista SP1, SQL Server Express 2005 I'm able to connect to my localhost
The following test fails: #!/usr/bin/env python def f(*args): >>> t = 1, -1 >>>
Env: Tomcat 5.x on Java 1.5.x on Windows using OracleJDBC driver on Oracle 9i
I am using a third-party API (Spreadshirt's API) and in order to perform a
I have an XML document that looks like this: <kmsg xmlns=http://url1 xmlns:env=url1 xmlns:xsi=http://www.w3.org/2001/XMLSchemainstance xsi:schemaLocation=http://location

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.