Solved

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

Posted on 2014-03-13
4
276 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 74

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

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

This document covers how to connect to SQL Server and browse its contents.  It is meant for those new to Visual Studio and/or working with Microsoft SQL Server.  It is not a guide to building SQL Server database connections in your code.  This is mo…
Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…

707 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

12 Experts available now in Live!

Get 1:1 Help Now