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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T06:02:43+00:00 2026-05-26T06:02:43+00:00

I have an application that I was writing that communicates with a third-party application

  • 0

I have an application that I was writing that communicates with a third-party application via a Component Object Model library. I must reference this COM library within the Visual Studio project itself in order for the application I am writing to work. There is also a .NET wrapper library that I must reference in the Visual Studio project in order to communicate with the COM library.

Is there a way to to create a conditional initialization of a class, in order to use a method within a .NET class within the .NET wrapper library, that will work in a later version of the third-party COM library itself.

The problem I ran into was that I was trying to reference a feature of the COM library that only existed in a later version. The version of the wrapper itself was identical because it was backwards compatible. When I attempted to access this new feature the program I was writing would silently close when I started it when the previous version of the third-party application was installed.

Is there a way I could have avoided this behavior without changing how the way the application itself was built?

  • 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-26T06:02:44+00:00Added an answer on May 26, 2026 at 6:02 am

    Not sure whether I understand term “reference a class”.

    You can do a conditional referencing of an entire Assembly (DLL)

    <Reference 
            Include="LegacyServices.dll" 
            Condition="$(AppVersion == '2.0')" />
    

    or conditionally include a source file into a project

    <Compile 
           Include="LegacyServices.cs" 
           Condition="$(AppVersion == '2.0')" />
    

    Both using MSBuild Condition in csproj file.

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

Sidebar

Related Questions

I have an application that I am writting that communicates with a third-party program
I am writing an application that communicates using sockets. I have a server running
I have a web application that I'm writing (C#, MSSQL) and I need to
I'm currently writing a web application that have about 6-12 pages. On each one
I have a C++ Windows application that can be extended by writing C++ plugins,
I'm writing a web application that will have plugins. The plugins will be .DLL
I am writing a PHP application that will have the ability to edit settings
I'm writing a drawing application that includes shapes that can have children. When I
I have just been involved in writing an application that does not use Doctype's
I am writing an application that writes to SQL Compact files that have a

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.