Blog entries for category ".NET":
Some of my friends already know that I have been working on something new over the last few months. Having helped shipping Windows 8, its Store App runtime for .NET applications, and the Async language and Framework features in .NET 4.5 was an awesome experience. I am very proud of our work. But over the last several moths I worked on something new – first a side project, it has now become a full feature. I wished I could have done this as a part of the .NET Team, but resource constraints and business priorities did not make this possible. Today I can talk about it publically, as my own boss. Exciting!
I continue working very closely with the Framework teram, and together we are announcing todfay a crucial update to Windows 8 Store App API Framework.
Asynchronous programming is one of the central themes of the .NET Framework 4.5 release. The
await keywords in C# 5 and Visual Basic 11 bring a new quality to working with asynchronous code. I had heaps of fun working on the underlying technologies.
The Windows Runtime (WinRT) has also adopted the asynchronous programming model. The WinRT APIs, introduced in Windows 8, are central to writing Windows Store Apps. WinRT async APIs are different than the .NET Task-based async APIs. However, you can use WinRT async APIs as seamlessly as pure .NET APIs, with the same keywords and the same usage principles. In this article I go into detail on how you can do that.
I review the most important types in the WinRT async infrastructure, and how they relate to similar .NET concepts. After that I walk over creating a complete Windows Store App with several different asynchronous operations. I show how to start asynchronous operations, how to retrieve results, and how to work with cancellations and progress monitoring.
Want to know more? Read on..
My sample App can be downloaded from MSDN.
This article assumes that you have a basic familiarity with using the
await keywords with .NET APIs in C#. Thanks to Rich and Brandon who helped with the editing, upload and publication or this article.
Update (Feb 2013): Late last year my colleagues published a new version of the Async Targeting Pack, titled "Microsoft.Bcl.Async". It adds support for Windows Phone 7.5 and the Portable Class Libraries.
[More info on the BCL blog]
[NuGet page for the Microsoft.Bcl.Async package]
One of the things I have been working on over the past year or so is the end-to-end experience with Asynchronous Programming in the .NET Framework. This is a very large effort involving dozens of people. Today I'd like to advertise one component of this experience we have recently released:
The Async Targeting Pack for Visual Studio 2012 is now available for .NET 4 and Silverlight 5.
The Async Targeting Pack (available via NuGet) allows Visual Studio 2012 to use the new async / await language features in projects that target .NET 4.0 and Silverlight 5.
A memory mapped files is virtual memory mapped to a physical file on disk, byte-by-byte. Or is it? Like with all advanced technology, the devil is in the detail...
Memory mapped files offer a number of benefits over traditional stream-based I/O. Advantages include random access performance, or the ability to share data across processes. The .NET framework provides built-in support for memory mapped files starting from version 4. In most cases using memory mapped files in .NET is as easy as using traditional file streams: just map a file into memory, open a seekable memory stream, and use it like a normal file while enjoying the performance benefits.
However, some tricky details lurk behind a corner: For instance - what are those weird bytes where an EOF was expected? Wanna know? Read on..
Regular Expressions are a powerful, yet a deceptive text mining tool. There are many pitfalls. One pit that is particularly easy to fall into is that a (sub-)expression can obtain a completely different meaning if it is put within the context of a another (sub-)expression. For instance, using the presumably straight-forward Set operator can be quite tricky..
Evolutionary algorithms, genetic programming and self-correcting systems have long remained in the realm of research prototypes and academic experiments. Not any more. It appears that many years of research, cross-team collaboration and internal testing are about to culminate in a main stream product that utilises evolutionary techniques in a real main-stream software development framework.
Today the Microsoft .NET Framework and Base Class Libraries Team is happy to announce some very exciting news..
Every year again comes the DST change...
And every year again .NET developers get confused about a whole hour mysteriously missing from their logs. Others, in contrast, seem to experience an unwelcome déjà vu and to encounter things twice.
In this brief article I discuss how the
DateTime type causes many of these problems and give a few tips on using the
DateTimeOffset type to avoid most of the problems associated with
DateTime in the context of DST transitions.
Do you know why "
Greenwich Standard Time"-zone has no daylight saving time? And why "
US Eastern Standard Time" does not actually apply anywhere on the Atlantic coast of the United States? In this brief article I talk about the pitfalls of name IDs in the Windows time zone database and about what to look out for when doing time zone programming under .NET.