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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T04:59:32+00:00 2026-05-28T04:59:32+00:00

I have an asynchronous library which is compiled under .NET 3.5, since it’s used

  • 0

I have an asynchronous library which is compiled under .NET 3.5, since it’s used by .NET 3.5 applications, but I want to be able to deal with .NET 4.0 CancellationTokens if someone wants to pass one in. In order to include .NET 4.0 stuff, I have to break compatibility with .NET 3.5. The only option I’ve come up with so far would be to just allow passing in “object” and then use reflection, but that makes for an ugly public interface… I want to make sure the client code is passing in the correct object type at compile time, not runtime.

Is there any way to bind against .NET 4.0 objects at compile time, without introducing an unnecessary dependency to consumer applications? To say “use this feature if it’s there, and skip it if it’s not”?

  • 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-28T04:59:33+00:00Added an answer on May 28, 2026 at 4:59 am

    You could have the public interfaces that require .NET 4.0 types in a separate assembly, possibly as Extension methods – and if you need to (e.g. interact between the .NET 4 types and the internals of your types in the main assembly) you could define an interface in your main (.NET 3.5) assembly and implement it in the .NET 4 assembly with a wrapper around a .NET 4 type in order to avoid reflection entirely.

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

Sidebar

Related Questions

Using a .NET TcpClient if I have called an asynchronous BeginRead() on the associated
I have not been able to find a way to cancel/terminate asynchronous read operation
I have win32 application in which winsock is used for TCP/IP communication. I am
I'm writing a class library that will offer some asynchronous processing, and want to
say I have an asynchronous library, written in native C++, with an interface similar
We are trying to produce a library component which will perform asynchronous calls. For
I have an asp.net page that will need to do some asynchronous work, e.g
I have created a library which can download JSON data which is then placed
I have found Android Asynchronous Http Client library from google: http://loopj.com/android-async-http/ This is awesome
I have the following piece of code which uses the ALAssets library to store

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.