<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://blogs.msdn.com/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Using async/await without .NET Framework 4.5</title><link>http://blogs.msdn.com/b/bclteam/archive/2012/10/22/using-async-await-without-net-framework-4-5.aspx</link><description>[ Update : We've uploaded a new version of Microsoft.Bcl.Async NuGet package. The previous version will not work correctly on Windows Phone 7.1] 
 Do you want to use await but don&amp;rsquo;t want to wait until you can target .NET Framework 4.5? The waiting</description><dc:language>en-US</dc:language><generator>Telligent Evolution Platform Developer Build (Build: 5.6.50428.7875)</generator><item><title>re: Using async/await without .NET Framework 4.5</title><link>http://blogs.msdn.com/b/bclteam/archive/2012/10/22/using-async-await-without-net-framework-4-5.aspx#10378922</link><pubDate>Tue, 18 Dec 2012 07:24:27 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:10378922</guid><dc:creator>Bartłomiej Legiędź</dc:creator><description>&lt;p&gt;Hello,&lt;/p&gt;
&lt;p&gt;Can you, please, look at &lt;a rel="nofollow" target="_new" href="https://connect.microsoft.com/VisualStudio/feedback/details/774617/methodaccessexception-when-using-async-for-wp7-5-version-1-0-12-beta"&gt;connect.microsoft.com/.../methodaccessexception-when-using-async-for-wp7-5-version-1-0-12-beta&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;It was mentioned here couple of times and is really annoying.&lt;/p&gt;
&lt;p&gt;Thank you in advance for solving it.&lt;/p&gt;
&lt;p&gt;Otherwise it is a great work. Please keep it going!&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10378922" width="1" height="1"&gt;</description></item><item><title>re: Using async/await without .NET Framework 4.5</title><link>http://blogs.msdn.com/b/bclteam/archive/2012/10/22/using-async-await-without-net-framework-4-5.aspx#10378115</link><pubDate>Fri, 14 Dec 2012 14:38:59 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:10378115</guid><dc:creator>Binding issue with C++ project</dc:creator><description>&lt;p&gt;I am currently using the new async library across a project with a large number of interdependent assemblies, I have had to use assembly binding redirect in each project to get it to compile (as per issue 2 in &lt;a rel="nofollow" target="_new" href="http://blogs.msdn.com/b/bclteam/p/asynctargetingpackkb.aspx"&gt;blogs.msdn.com/.../asynctargetingpackkb.aspx&lt;/a&gt;).&lt;/p&gt;
&lt;p&gt;The problem I now have is that I consume one of these libraries from a C++/CLR DLL project, it does not actually need to use async but I have the following compilation error:&lt;/p&gt;
&lt;p&gt;2&amp;gt;C:\Windows\Microsoft.NET\Framework\v4.0.30319\Microsoft.Common.targets(1578,5): warning MSB3268: The primary reference &amp;quot;ImInterface.dll&amp;quot; could not be resolved because it has an indirect dependency on the framework assembly &amp;quot;System.Runtime, Version=1.5.11.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a&amp;quot; which could not be resolved in the currently targeted framework. &amp;quot;.NETFramework,Version=v4.0&amp;quot;. To resolve this problem, either remove the reference &amp;quot;ImInterface.dll&amp;quot; or retarget your application to a framework version which contains &amp;quot;System.Runtime, Version=1.5.11.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a&amp;quot;.&lt;/p&gt;
&lt;p&gt;I have added the same app.config file that I have used in all of the C# projects but it does not seem to be having any effect in the C++ project. Do I have to place it in a specific directory or perform any other steps to enable the app.config file to be recognised?&lt;/p&gt;
&lt;p&gt;Regards,&lt;/p&gt;
&lt;p&gt;Anthony&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10378115" width="1" height="1"&gt;</description></item><item><title>re: Using async/await without .NET Framework 4.5</title><link>http://blogs.msdn.com/b/bclteam/archive/2012/10/22/using-async-await-without-net-framework-4-5.aspx#10375671</link><pubDate>Fri, 07 Dec 2012 21:59:05 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:10375671</guid><dc:creator>Tom</dc:creator><description>&lt;p&gt;Hm maybe i didnt explain my problem well. &amp;nbsp;All my projects (Windows Phone, .NET, Windows Store and Portable libraries) build into the same directory. &amp;nbsp;(something like SubversionRoot\Binaries\Debug\)&lt;/p&gt;
&lt;p&gt;For example if i want to create a .NET 4.0 application that references a portable library that targets .NET40, WP7.1, SL4, etc. &amp;nbsp;Both projects (the .NET 4 application and the portable library) depend on async e.g. on the &amp;nbsp;System.Runtime.dll assembly. Which dll should i copy to the output? The .NET40 specifc (2.5.11.0) or the Portable Library specific (1.5.11.0). I think i need both... unfortunatelly they have the same file name, so i can&amp;#39;t copy both into the same output folder.&lt;/p&gt;
&lt;p&gt;Another example:&lt;/p&gt;
&lt;p&gt;I have a .NET Application, a WindowsPhone application. Both applications depend on a portable library. All Projects use async and build into the same directory. Which bcl assemblies should i copy to the output? I think i can&amp;#39;t solve it because i need different versions of the same assembly in my output directory.&lt;/p&gt;
&lt;p&gt;I have the same problem with this assembly:&lt;/p&gt;
&lt;p&gt;System.Threading.Tasks&lt;/p&gt;
&lt;p&gt;Thats just an example. I would prefer if the bcl assemblies would have different assembly and file names like&lt;/p&gt;
&lt;p&gt;System.Runtime.Portable&lt;/p&gt;
&lt;p&gt;System.Runtime.Net40&lt;/p&gt;
&lt;p&gt;System.Runtime.WindowsPhone&lt;/p&gt;
&lt;p&gt;System.Threading.Tasks.Portable&lt;/p&gt;
&lt;p&gt;System.Runtime.Net40&lt;/p&gt;
&lt;p&gt;System.Runtime.WindowsPhone&lt;/p&gt;
&lt;p&gt;etc.&lt;/p&gt;
&lt;p&gt;I this case i would have no problem, all async assemblies could be copied to the output and also referenced from the same directory.&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10375671" width="1" height="1"&gt;</description></item><item><title>re: Using async/await without .NET Framework 4.5</title><link>http://blogs.msdn.com/b/bclteam/archive/2012/10/22/using-async-await-without-net-framework-4-5.aspx#10375661</link><pubDate>Fri, 07 Dec 2012 21:14:53 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:10375661</guid><dc:creator>David Kean [MSFT]</dc:creator><description>&lt;p&gt;@Tom: In the properties of each reference, change &amp;quot;Copy Local&amp;quot; to false for each version that you don&amp;#39;t want to copy to the output folder. Be careful however, you want to make sure that Phone, Silverlight, etc projects get exactly the binary that they built against when they are packaged. ie Phone 7.5 must get System.Runtime, v1.5 and System.Threading.Tasks, v1.5.&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10375661" width="1" height="1"&gt;</description></item><item><title>re: Using async/await without .NET Framework 4.5</title><link>http://blogs.msdn.com/b/bclteam/archive/2012/10/22/using-async-await-without-net-framework-4-5.aspx#10375630</link><pubDate>Fri, 07 Dec 2012 18:32:33 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:10375630</guid><dc:creator>Tom</dc:creator><description>&lt;p&gt;When i want to build every project into the same folder, what do you suggest how to handle the fact that some assembly for the different platforms (Portable, .NET 4, WP7.1) (e.g. Microsoft.Threading.Tasks) have the same name? The last built project will win and overwrite the platform specific assemblies of the other projects.&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10375630" width="1" height="1"&gt;</description></item><item><title>re: Using async/await without .NET Framework 4.5</title><link>http://blogs.msdn.com/b/bclteam/archive/2012/10/22/using-async-await-without-net-framework-4-5.aspx#10373455</link><pubDate>Fri, 30 Nov 2012 11:54:40 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:10373455</guid><dc:creator>andreas_huber69</dc:creator><description>&lt;p&gt;@Immo: Thanks for your quick response. IMHO, this is a limitation that should be clear to anyone using async/await on platforms like .NET 4, Windows Phone 7.5, etc.&lt;/p&gt;
&lt;p&gt;BTW, the AsyncExtensions.ReadAsync method calls Stream.BeginRead/EndRead, so as a workaround one could override those methods. Of course, the implementation could still take advantage of async/await:&lt;/p&gt;
&lt;p&gt;// untested code&lt;/p&gt;
&lt;p&gt;public override IAsyncResult BeginRead(byte[] buffer, int offset, int count)&lt;/p&gt;
&lt;p&gt;{&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;return this.ReadAsyncCore(buffer, offset, count, CancellationToken.None);&lt;/p&gt;
&lt;p&gt;}&lt;/p&gt;
&lt;p&gt;private async Task&amp;lt;int&amp;gt; ReadAsyncCore(byte[] buffer, int offset, int count, CancellationToken cancellationToken)&lt;/p&gt;
&lt;p&gt;{&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;// implementation with await &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/p&gt;
&lt;p&gt;}&lt;/p&gt;
&lt;p&gt;The caveats I see are:&lt;/p&gt;
&lt;p&gt;- A CancellationToken passed to AsyncExtensions.ReadAsync is not observed&lt;/p&gt;
&lt;p&gt;- a (probably small) perf hit due to the additional indirection&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10373455" width="1" height="1"&gt;</description></item><item><title>re: Using async/await without .NET Framework 4.5</title><link>http://blogs.msdn.com/b/bclteam/archive/2012/10/22/using-async-await-without-net-framework-4-5.aspx#10373167</link><pubDate>Thu, 29 Nov 2012 18:23:39 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:10373167</guid><dc:creator>Immo Landwerth [MSFT]</dc:creator><description>&lt;p&gt;@andreas_huber69: Unfortunately not. Portable class libraries can&amp;#39;t add new APIs to existing types. In those cases, we use extension methods. The only clean way is to ensure that the platforms you are targeting have the APIs you want to use. In your case, targeting .NET 4.5, Phone 8 and Windows Store should do the trick.&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10373167" width="1" height="1"&gt;</description></item><item><title>re: Using async/await without .NET Framework 4.5</title><link>http://blogs.msdn.com/b/bclteam/archive/2012/10/22/using-async-await-without-net-framework-4-5.aspx#10373117</link><pubDate>Thu, 29 Nov 2012 16:15:22 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:10373117</guid><dc:creator>andreas_huber69</dc:creator><description>&lt;p&gt;Suppose I want to compile a Stream subclass into a PCL targeting .NET 4.0 and e.g. .NET for Windows Store apps. For such a PCL, the Stream class does not offer the ReadAsync method. Instead, these methods are only available as extension methods. Is there a clean way to override said method, such that a .NET 4 client can call ReadAsync on a Stream reference pointing to a subclass object?&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10373117" width="1" height="1"&gt;</description></item><item><title>re: Using async/await without .NET Framework 4.5</title><link>http://blogs.msdn.com/b/bclteam/archive/2012/10/22/using-async-await-without-net-framework-4-5.aspx#10371801</link><pubDate>Mon, 26 Nov 2012 23:04:20 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:10371801</guid><dc:creator>Immo Landwerth [MSFT]</dc:creator><description>&lt;p&gt;@rpooley: Thanks for coming back. I&amp;#39;d suggest you use TaskEx.FromResult() instead (Why is it not on Task? Well, because we couldn&amp;#39;t put it there for technical reasons).&lt;/p&gt;
&lt;p&gt;@King Kikapu: Glad you like it! I don&amp;#39;t think VS will prompt you, but you the NuGet package manager dialog will show you when updates are available.&lt;/p&gt;
&lt;p&gt;@Dan: Sorry for the inconvenience, but glad you found the solution.&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10371801" width="1" height="1"&gt;</description></item><item><title>re: Using async/await without .NET Framework 4.5</title><link>http://blogs.msdn.com/b/bclteam/archive/2012/10/22/using-async-await-without-net-framework-4-5.aspx#10371182</link><pubDate>Fri, 23 Nov 2012 17:55:32 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:10371182</guid><dc:creator>Dan</dc:creator><description>&lt;p&gt;I solved my problem. &amp;nbsp;Nuget needed to be updated to version 2.1 as PCL&amp;#39;s aren&amp;#39;t supported in version 2.0&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10371182" width="1" height="1"&gt;</description></item></channel></rss>