You can use this workaround to create async task-based wcf client in .Net 4.0
- Open NuGet and add the "Microsoft.Bcl.Async" package to your .Net 4.0 project
- Create a new solution with a new .Net 4.5 project with the same name that your .Net 4.0 project
- Add a service reference (to the desired web service) with the same name that the service reference created in the .Net 4.0 project
- Be sure that the "Generate task-based operations" option under "Allow Generation of asynchronous operations" is checked in the advanced options dialog
- Open the service reference folder of your .Net 4.5 project ("NET_4.5_PROJECT_FOLDER\Service References\YOUR__SERVICE_REFERENCE_FOLDER\")
- Copy all the files from folder
- Open the service reference folder of your .Net 4.0 project ("NET_4.0_PROJECT_FOLDER\Service References\YOUR__SERVICE_REFERENCE_FOLDER\")
- Paste the files (to the .Net 4.0 service reference folder) that you have copied before (from the .Net 4.5 service reference folder)
In conclusion, you have to generate the service reference in .Net 4.5 and copy it to your .Net 4.0 project. It is mandatory to add the "Microsoft.Bcl.Async" package to your .Net 4.0 project.
EDIT
I have discovered that this workaround only works if .Net Framework 4.5 is installed on the computer. If you run the program in a computer with .Net Framework 4.0 installed it doesn't work (Windows XP is not supported in .Net Framework 4.5, so it is a good environment to test the program).
This exception is thrown when .Net Framework 4.0 is not installed:
Type 'System.Threading.Tasks.Task`1[System.Boolean]' cannot be serialized. Consider marking it with the DataContractAttribute attribute, and marking all of its members you want serialized with the DataMemberAttribute attribute. If the type is a collection, consider marking it with the CollectionDataContractAttribute. See the Microsoft .NET Framework documentation for other supported types.
Summing up, it is not a good workaround.