Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

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

Posted on 2014-03-13
4
Medium Priority
?
323 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 2000 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

Windows Server 2016: All you need to know

Learn about Hyper-V features that increase functionality and usability of Microsoft Windows Server 2016. Also, throughout this eBook, you’ll find some basic PowerShell examples that will help you leverage the scripts in your environments!

Question has a verified solution.

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

It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
High user turnover can cause old/redundant user data to consume valuable space. UserResourceCleanup was developed to address this by automatically deleting user folders when the user account is deleted.
Want to learn how to record your desktop screen without having to use an outside camera. Click on this video and learn how to use the cool google extension called "Screencastify"! Step 1: Open a new google tab Step 2: Go to the left hand upper corn…
Is your OST file inaccessible, Need to transfer OST file from one computer to another? Want to convert OST file to PST? If the answer to any of the above question is yes, then look no further. With the help of Stellar OST to PST Converter, you can e…

773 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