Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <blockquote> <p>I am targeting the .NET 4.0 framework and am unsure as to any additional assemblies required</p> </blockquote> <p>It is possible to run <code>async/await</code> code in .NET 4.0 without isntalling .NET 4.5, <a href="https://stackoverflow.com/questions/15338907/where-can-i-find-a-tpl-dataflow-version-for-4-0/15972581#15972581">having included or referenced <code>AsyncCtpLibrary.dll</code> from Async CTP</a>. It is impossible to install .NET 4.5 or Visual Studio 2012 on Windows XP and .NET 4.0 without .NET 4.5 installed is different from .NET 4.0 with installed .NET 4.5.<br> Read, for example, this discussion: </p> <ul> <li>on MSDN forum: <a href="http://social.msdn.microsoft.com/Forums/en-US/wpf/thread/c05a8c02-de67-47a9-b4ed-fd8b622a7e4a/" rel="nofollow noreferrer">"If I target .net 4.0 but run on a machine that has .net 4.5 will .net 4.0 WPF bugs still be there?"</a> </li> </ul> <p>I disadvise to use Nuget on machine without .NET 4.5 for getting extensions for .NET 4.0 as it is really bringing compatible packs either for wrong .NET 4.5 or for .NET 4.0 from .NET 4.5 incompatible with .NET 4.0 without .NET 4.5 </p> <p>But your code has a syntax error </p> <p>You should have return type <code>Task&lt;string[]&gt;</code>, instead of your <code>Task&lt;string&gt;</code>, in <code>AccessTheWebAsync()</code> method declaration, i.e. you should have written: </p> <pre><code>public async Task&lt;string[]&gt; AccessTheWebAsync(Class1 class1, Class2 class2)() </code></pre> <p>instead of</p> <pre><code>public async Task&lt;string&gt; AccessTheWebAsync(Class1 class1, Class2 class2)() </code></pre> <p>in order for this method to return values of type <code>string[]</code>: </p> <pre><code>return listContents;//where listContents is declared as string[] type </code></pre> <p><strong>Update:</strong><br> Checked that OP's code run after this correction on my <a href="https://stackoverflow.com/questions/15338907/where-can-i-find-a-tpl-dataflow-version-for-4-0/15972581#15972581">true .NET 4.0 (without .NET 4.5 and VS2012) Windows XP machine with Async CTP</a> </p> <p>Why was my answer downvoted? anonymously... </p> <p>It is obvious that if OP asks such question that he does not have .NET 4.5 installed. He will not be able to use <a href="http://blogs.msdn.com/b/lucian/archive/2012/04/24/async-targeting-pack.aspx" rel="nofollow noreferrer">Async Targeting Pack</a> referencing <a href="http://nuget.org/packages/Microsoft.Bcl.Async" rel="nofollow noreferrer">"Async for .NET Framework 4, Silverlight 4 and 5, and Windows Phone 7.5 and 8 1.0.16"</a> without installing VS2012, anв the latter is simply impossible on Wondows XP, with Nuget bring wrong packs in VS2010 incompatible and impossible to use on .NET 4.0 without .NET 4.5 installed </p> <p>Checked it many times, in may contexts </p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload