Solved

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

Posted on 2014-03-13
4
280 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
  • 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Introduction Hi all and welcome to my first article on Experts Exchange. A while ago, someone asked me if i could do some tutorials on object oriented programming. I decided to do them on C#. Now you may ask me, why's that? Well, one of the re…
Today I had a very interesting conundrum that had to get solved quickly. Needless to say, it wasn't resolved quickly because when we needed it we were very rushed, but as soon as the conference call was over and I took a step back I saw the correct …
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, just open a new email message. In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
Learn how to create flexible layouts using relative units in CSS.  New relative units added in CSS3 include vw(viewports width), vh(viewports height), vmin(minimum of viewports height and width), and vmax (maximum of viewports height and width).

910 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

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now