Solved

Can a VS 4.0 framework app consume a VS 4.5 framework DLL?

Posted on 2014-03-13
4
293 Views
Last Modified: 2014-03-19
I am building a DLL for my office and it needs to use Async (a 4.5 framework tool).  Many of our programs that use this DLL are 4.0 framework apps.  So can I put async in the DLL and still have those programs use the methods that have async in them (BTW, no 4.5 objects will be returned to the calling program)?
0
Comment
Question by:David L. Hansen
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 21

Accepted Solution

by:
Craig Wagner earned 500 total points
ID: 39927801
Unless the machine on which the code is running has been upgraded to 4.5 then no, it won't work. The CLR has to be able to understand and execute the code in the assembly. If the execution environment only has 4.0 then you'll have to use one of the older approaches to doing asynchronous operations.
0
 
LVL 75

Expert Comment

by:käµfm³d 👽
ID: 39928350
This is total speculation, but the async and await keywords are just syntactic sugar for the compiler to create a state machine for you. Since async methods return Task<T>, and Task was introduced in .NET 4.0, it may be possible. It could be worth putting together a quick throw-away project to test.
0
 
LVL 15

Author Comment

by:David L. Hansen
ID: 39935618
I'm thinking that the machine running the consuming program would implement the DLL alright, even if that program was a 4.0 framework program, so long as the 4.5 framework was installed on that machine.

Sorry for the delay in responding guys.
0
 
LVL 15

Author Closing Comment

by:David L. Hansen
ID: 39940675
Thank you very much
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Parsing a CSV file is a task that we are confronted with regularly, and although there are a vast number of means to do this, as a newbie, the field can be confusing and the tools can seem complex. A simple solution to parsing a customized CSV fi…
Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
How to Install VMware Tools in Red Hat Enterprise Linux 6.4 (RHEL 6.4) Step-by-Step Tutorial
Attackers love to prey on accounts that have privileges. Reducing privileged accounts and protecting privileged accounts therefore is paramount. Users, groups, and service accounts need to be protected to help protect the entire Active Directory …

739 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question