I’m pleased to announce a preview of the Reactive Extensions for .NET (Rx) on MSDN DevLabs.
Using Rx, programmers can write succinct declarative code to orchestrate and coordinate asynchronous and event-based programs based on familiar .NET idioms and patterns. Rx has a strong theoretical basis by using the duality between the classic Iterator and Observer design patterns to simplify controlling asynchrony. By combining the expressiveness of LINQ with the elegance of category theory, Rx allows programmers to write asynchronous code without performing cruel and unnatural acts.
As the name implies, reactive programs react to changes in their environment. Traditionally, programmers use locks and event handlers to coordinate these changes. Rx models asynchronous computations and events as push-based, or observable, collections, thus expanding the scope of the standard LINQ sequence operators and extension methods beyond the familiar pull-based, or enumerable, collections into the realm of reactive programming.
Practical and Pragmatic
The Reactive Extensions for .NET is a set of extension methods and an implementation of the LINQ standard sequence operators for the new IObservable<out T> and IObserver<in T> interfaces in .NET 4 and Silverlight 4. The observable interfaces were added to .NET to provide a common interface for push-based notifications that other .NET features and libraries can build on top of. Rx focuses on coordination and orchestration of event-based and asynchronous computations and leverages the new Task Parallel library as its underlying concurrency mechanism.
The Reactive Extensions can be used from any .NET language. In F#, .NET events are first-class values that implement the IObservable<out T> interface. In addition, F# provides a basic set of functions for composing observable collections and F# developers can leverage Rx to get a richer set of operators for composing events and other observable collections.
The Silverlight Toolkit uses Rx to power the Silverlight Toolkit Drag and Drop Framework, a subset of the WPF APIs for initiating and interacting with drag operations. The Drag and Drop Framework adds drag and drop support to core controls such as Treeview, DataGrid, ListBox. Rx drastically reduced development time by allowing drag operations, which are sequences of user events, to be described declaratively. Silverlight creates visual elements asynchronously and as a result it is often necessary to write asynchronous test code to ensure that a component has been correctly created. The addition of Rx to the Silverlight unit testing framework allows developers to write reliable event-based tests without sacrificing readability.
Show me Some Code
The example below shows a simple AJAX-style reactive program that translates English using the Bing translation service and displays the results.
The input field in the page is exposed as an observable collection of strings that produces a value whenever the user has paused typing for a half second. The GetKeyUpEvents extension method exposes the standard .NET KeyUp event as an observable collection.
IObservable<string> words = (from keyup in Input.GetKeyUpEvents() select Input.Value).Throttle(TimeSpan.FromSeconds(.5))
To access the Bing translation service, we simply convert a simple WCF service reference that uses the standard .NET BeginInvoke/EndInvoke or event-based async pattern into a function that returns a singleton observable collection via one of the standard helper functions that Rx provides.
IObservable<TranslationResponse> Translate(this string text, string sourceLanguage, string destinationLanguage){…}
The coordination between the various computations uses a LINQ query that sends requests to the Bing translation service to translate each word into Dutch, French, and Spanish and then waits for the first two of three results to return using a join pattern.
var translations = from word in words
let dutch = Bing.Translate(word, "en", "nl")
let french = Bing.Translate(word, "en", "fr")
let spanish = Bing.Translate(word, "en", "es")
from results in Observable.Join
( dutch.And(spanish).Then((d, s) =>
new { Dutch = d, French = Bing.NoResult, Spanish = s })
, dutch.And(french).Then((d, f) =>
new { Dutch = d, French = f, Spanish = Bing.NoResult })
, french.And(spanish).Then((f, s) =>
new { Dutch = Bing.NoResult, French = f, Spanish = s })
).Until(words)
select results;
Finally, we subscribe to the results of the translations and update the UI once we get notified of a change.
translations.Subscribe(result =>
{
Dutch.InnerText = result.Dutch.GetTranslatedTerm();
French.InnerText = result.French.GetTranslatedTerm();
Spanish.InnerText = result.Spanish.GetTranslatedTerm();
});
Developers don’t need to worry about executing the subscription on the correct thread; the Rx runtime takes care of it.
Bonus Material
Besides the extension methods on observable collections, Rx also contains a number of more experimental types and namespaces that implement some of the new extension methods for observable collections over enumerable collections and an experimental back port of PLINQ to .NET 3.5 that are available to developers for experimentation.
Let’s Play
You can download Rx from DevLabs. Tell us what you think on the project forum, and check out videos and screencasts on Channel 9.
Namaste!
Building your application or service for the cloud lets you focus on building the right software using the skills you already have while someone else handles the details of infrastructure, hardware, and service management.
Windows Azure, Microsoft's platform for cloud-based applications, has been available in CTP form for the past year, and Visual Studio has supported the development of Windows Azure applications since the very first CTP release through an add-in known as Windows Azure Tools. This add-in is available for VS 2008 via the Web Platform Installer. Visual Studio 2010 Beta 2 has all the features you need to code, debug, and deploy your cloud service.
Windows Azure allows you to build robust production-quality applications that can be deployed, maintained and supported, and Windows Azure is accompanied by the November 2009 release of the add-in for Visual Studio, which lets you take advantage of the platform in the most efficient way.
Getting Started
Developing for Windows Azure is very similar to developing an ASP.NET application for IIS and Windows Server. However, there are some differences, and Visual Studio makes it much easier to navigate those differences.
One of the first things that you'll notice when developing for the cloud with Visual Studio is the introduction of a top-level Cloud tab on the Get Started section of the redesigned Start Page. This page offers up a wealth of resources that cover creating your first cloud application and contain resources that will continue to be useful again and again, such as links to the community areas for Windows Azure and regular updates about new features and services offered.

You can create your own cloud service using the Cloud Service project template that is part of the Visual Studio 2010 (and Visual Web Developer 2010 Express) installation. Click on the File | New | Project... menu, browse to either the Visual Basic and Visual C# nodes, and select the Cloud Service node that contains a project template called "Enable Windows Azure Tools".

This template, new in Beta 2, makes it very easy to get the latest tools for developing Windows Azure services. After creating the project, the template will direct you to download the Windows Azure Tools in order to continue. This guarantees that you'll be using the latest version of the tools that support the latest version of Windows Azure.

After installing the tools, the New Project dialog will provide an option to create a Windows Azure Cloud Service. Visual Studio now supports creating, editing, building, debugging and deploying these services.
To create a new project, use the File | New | Project... menu item to bring up the New Project Dialog and select "Windows Azure Cloud Service" under the Visual Basic or Visual C# nodes. This will bring up a dialog that can be used to add Windows Azure Role projects to your cloud service.

One of the unique aspects of Windows Azure is the ability to individually scale work across any number of instances. Windows Azure segments "components" into Roles. A Role is an individually scalable component running in the cloud where each instance of a Role corresponds to a virtual machine instance. There are two types of Roles:
- Web Role - a web application running on IIS that is accessible via an HTTP and/or HTTPS endpoint.
- Worker Role - a background processing application that runs arbitrary .NET code. It also has the ability to expose internet-facing and internal endpoints.
There are multiple template options for each type of Role you wish to add. For example, ASP.NET Web applications, ASP.NET MVC 2 and WCF Service Application templates are available to create a Web Role. Add one or more Roles to your cloud service and click OK to create the solution and projects.

After you've created the service, your solution has several projects in it. One of these is the Cloud Service project which contains all of the configuration information needed by Windows Azure in order to run your service and also provides the ability to add or remove Roles after project creation.
Right-clicking on the role associations under the Roles node and selecting "Properties..." will bring up a configuration page that makes it easy to set up each Role.

Getting It Just Right
One of the key benefits of using Visual Studio 2010 for developing Windows Azure Cloud Services is the simulation environment on which you can test, debug, and run your service completely locally without requiring a Windows Azure Account. This simulation includes the development fabric, which will run your cloud service the same way it runs in the cloud, and the development storage, which runs the Windows Azure storage on your machine. With the development fabric and storage, you can develop, test, and refine your cloud services offline.
When running in the development fabric you can use all of Visual Studio's powerful debugging features, including seamless debugging across different roles and role instances. Below, a debugging session allows you to step through the execution of a web role.

Deploying to the Cloud
Once you are ready to move your application to the cloud, Visual Studio provides a publish step that packages your cloud service into a deployable Windows Azure format, then you can deploy your cloud service using the Windows Azure Developer Portal.
To learn more about all of this, please visit the Cloudy in Seattle and Cloud Tools blogs.
Namaste!
Development teams and organizations often have many different platforms and development environments, and interoperability between those heterogeneous environments is a major collaboration challenge.
Teamprise’s Client Suite addresses those interoperability gaps by enabling developers using Eclipse and Eclipse-based IDEs on multiple operating systems, including Windows, Unix, Linux, and Mac OS X to build applications that leverage Microsoft Visual Studio Team Foundation Server.
I’m happy to announce today that Microsoft has acquired the Teamprise technology.
Microsoft is committed to the future of this technology and will be incorporating these tools into Visual Studio 2010. This will be available as part of the Visual Studio 2010 launch wave.
The acquisition of the Teamprise technology is an important step in our continued commitment to interoperability and our dedication to enabling customers to achieve greater business results, regardless of their current development environment.
Details of the acquisition are available on Microsoft PressPass.
Namaste!
Visual Studio 2010 and .NET 4 are packed with new features and enhancements designed to improve developer productivity. Some are small changes and others are more significant. Altogether they deliver a significant gain in productivity.
More and more developers look to the web to be able to build and deliver applications that take advantage of the reach and friction-free capabilities of the web. With Visual Studio 2010 and ASP.NET 4, there are a number of new features to help you do just that. I want to highlight a few of the new features here.
Snippets for HTML, ASP.NET and JavaScript
C# and VB users have used snippets for years to accelerate developer productivity. Now web developers can experience these same productivity gains with their HTML and ASP.NET markup and JavaScript. There are hundreds of new snippets that help you auto-complete common ASP.NET and HTML tags, including required attributes (such as runat="server") and common attributes specific to a tag (such as ID, DataSourceID, ControlToValidate, and Text).
Dynamic IntelliSense for JavaScript
One of the biggest challenges developers face when coding with dynamic languages such as JavaScript is that types are dynamically being added and changed. This is can render IntelliSense almost useless. In Visual Studio 2010, the JavaScript IntelliSense engine has been redesigned to work smoothly for dynamic types. For example, you’ll now get IntelliSense for types generated by registerNamespace. The engine also adds support for most common JavaScript libraries. Below is an example of IntelliSense for a newly-registered type with a new function.
Streamlined Web Deployment
Web deployment has always been a very challenging problem for web developers. Application logic, databases, IIS settings, data and configuration transforms all may need to be applied before deployment.
Now, MSDeploy, a new deployment tool, packages all the settings, files and data associated with a web application. These packages can then be deployed to remote sites or archived for future retrieval. The IIS7 management console now includes a wizard to import packages created by MSDeploy.
Visual Studio 2010 seamlessly integrates MSDeploy into the web development workflow and adds commonly-requested features such as automation of web.config transformations to modify common settings (such as web service end points and connection strings) and database deployment before moving from a developer’s machine to a staging or production server. Below is the new simplified publishing dialog:
New Application Templates
Getting started with web development can seem daunting for the new web developer. Visual Studio 2010 includes starter web application templates for ASP.NET 4. These templates include everything you need to get started: a master/content pattern for page consistency, menus, login, and CSS style sheets and jQuery for building JavaScript-rich apps. These templates give you get a working web application right from the start so you can get to work adding your own functionality.
CSS Improvements
ASP.NET controls now have a ClientIDMode property that allows you to change how ASP.NET controls generate the ClientID. Knowing the ClientID is particularly important when styling with CSS or writing JavaScript to access the HTML DOM.
The HTML designer in Visual Studio 2010 has enhanced support for CSS 2.1 that provides a more accurate rendering at designtime compared with how the browser will render the page at runtime.
More Screen Real Estate
One of the most valuable commodities in a development environment is screen real estate. Visual Studio 2010 offers an immense array of options developers can customize to optimize their screen real estate and development experience. The Code Optimized Web Profile optimizes these settings to maximize screen real estate and bring the commands most commonly used by the Source View developer to your fingertips. You can choose the Code Optimized Web Profile when you start Visual Studio for the first time or change your profile later using the Tools | Import and Export Settings… menu item.
Clean Web.Config
Sometimes less is more. This is one of those features. When ASP.NET was first introduced, a web.config file wasn’t even required. When it was, it often only contained a few entries. As new capabilities were added to ASP.NET, the web.config file grew in size and complexity, making the file more difficult to read and maintain. ASP.NET 4 brings back the minimal configuration file.
URL Routing with ASP.NET WebForms
URL routing is a feature common to MVC projects. ASP.NET 4 supports URL routing for web forms. Now you can define URLs that are meaningful to your app and understandable by users. These simplified URLs also help with search engine optimization (SEO).
Learn More
This is only a sample of the improvements for web developers in Visual Studio 2010. You can see a complete list of new features for web development here.
One More Thing...
If you have been using Visual Studio 2010 Beta 2, we'd like to hear from you. Please take the survey and tell us about your experiences.

Namaste!
Thorough, consistent, and extensible testing of systems remains one of the biggest challenges in creating and maintaining software systems.
The Spec Explorer tool released today on DevLabs tackles that problem using Model-Based Testing techniques.
What Is It?
Spec Explorer, is a tool for modeling software behavior and generating test suites from those models.
Models can be viewed as graphical renderings to understand and analyze the expected system behavior and communicate it to others. Model size can be scoped with regular expressions. The generated test suites can be run standalone in the Visual Studio test framework or other unit test frameworks.
Why Use It?
Several Microsoft projects of various sizes have already used Spec Explorer as part of their development process. Using Spec Explorer has helped those teams create test cases more quickly, ensure predictability of requirement coverage, and support the projects’ lifecycle management and software updates.
Spec Explorer’s unique features make it easier to learn than other Model-Based Testing tools. Engineers with no modeling background can create models of systems and features, then generate tests in a short amount of time. Studies on a large-scale project with over 300 test suites have shown a 42% average productivity gain over manually-created test suites.
While we’ve tuned Spec Explorer based on the feedback of teams within Microsoft, we now need your feedback to ensure Spec Explorer meets the needs of customers working on a variety of project types and sizes.
Download Spec Explorer today, ask questions or send feedback via the forum, and stay current via the team blog.
Namaste!

The MSDN Global Network is re-launching with a new design and new benefits for all MSDN subscribers.
MSDN subscriptions are the ultimate resource that give developers, teams, and organizations comprehensive access to Microsoft tools and technologies to confidently design, develop and test software solutions. Along with access to thousands of downloads, it offers professional support services and expert information resources to ensure developers can rise to the biggest challenges.
Today, we are announcing new benefits to better support developers and to help them grow their career. All MSDN and BizSpark subscribers will be able to leverage free e-learning courses in English. We are providing priority support to all subscribers through MSDN Forums. We are also announcing free Windows Azure Platform cloud computing use for MSDN Premium and BizSpark customers following Windows Azure commercial availability. To kick start developers on this powerful platform, subscribers will get 750 free compute hours per month for 8 months.
The MSDN network re-design supports our customers around the world, including 37 international sites. The goal of the new design is to improve the overall experience with the site and centers and help you be successful with the Microsoft products and technologies you have invested in. The new MSDN site includes a new visual design, new ways for the community to interact on the content, and new Silverlight controls to promote dynamic community content. This includes a Community Activity area featuring recent and most popular forums topics, code samples, and technical articles. The MSDN Library now has the ability to explore two new library views: ScriptFree (which sets the bar for performance by eliminating scripts and server round-trips) and the Lightweight Beta (a similar view to VS 2010 offline help experience).
This is just the start of an important investment we are making around our online assets to improve discoverability, readability, consistency, and relevance.
Feedback from MSDN users is crucial to making MSDN the best place to go from ideas to solutions. Thank you to everyone who has provided feedback and recommendations to make MSDN a better place. We are looking forward to hearing your additional input on the MSDN Site Feedback Forum on how to make MSDN even better.
Namaste!
I am pleased to announce the release of Visual Studio 2010 and .NET Framework 4 Beta 2. MSDN subscribers can download Beta 2 today. The beta will be available to the rest of the world on Wednesday.
Visual Studio 2010 has made significant enhancements since Beta 1. We’ve come a long way in performance and general stability, and while there is more work to do before we release Visual Studio 2010, we hope you’ll like what you see.
Beta 2 also includes integrated tooling for SharePoint, including project templates and debugging support, and runtime and tooling support for developing great Windows 7 applications.
Since Beta 1, new Windows Azure Tools templates make it easy to get started developing Windows Azure applications, and enhanced support for Silverlight 3 databindings let you focus on writing your code.
Team Foundation Server is now included in all versions of Visual Studio 2010 with MSDN. For small teams that need only core development features such as source control, bug tracking, and build automation, TFS Basic offers a simple, streamlined install and runs on server or client machines. Test Elements users will notice a more intuitive and responsive user interface.
We’ve been making improvements to the .NET Framework as well. I’m happy to say that the download size of .NET Framework 4 Beta 2 is greatly reduced from previous versions of the .NET Framework, with most flavors coming in under 50 megabytes. Significant improvements to WPF’s text rendering stack make text sharper. You will notice sharper text in the Visual Studio 2010 editor.
We are also announcing a simplified product lineup and pricing options today, as well as new benefits for MSDN subscribers. For MSDN Premium subscribers, the “Ultimate Offer” will offer access to the next level of Visual Studio 2010 at launch on March 22, 2010. Find out more about the new product lineup and the “Ultimate Offer” here.
Visual Studio 2010 Beta 2 is available today for MSDN subscribers and will be available October 21st for public download. Keep an eye on the Visual Studio 2010 Product Page for or sign up to be notified when it becomes available. The team and I are looking forward to hearing your feedback.
Namaste!
With Visual Studio, we strive to give your organization the tools to tackle a broad range of software problems with the interoperability and efficiency that you need and have come to expect from software based on the .NET Framework.
As part of this, Visual Studio 2010 marks the first release to directly support functional programming through the F# programming language.
F# is a highly productive .NET programming language combining functional programming and object-oriented programming, and is ideally suited for parallel, algorithmic, technical and explorative development. F# is the result of a close partnership between Microsoft Research and the Visual Studio team, and since announcing F# in Visual Studio 2010 we’ve seen a surge of interest and uptake in the language. We’ve also worked closely with the F# community and major adopters to ensure it meets the needs of professional software developers working in these domains.
F# brings many new features to Visual Studio 2010, covering everything from “programming in the small” with Tuples and functions to simple, error-free asynchronous programming and strong types for floating point code. Below are a few of the highlights of this addition to the Visual Studio languages.
Simple, Succinct Syntax
F# is a strongly-typed language like C#, but with a lightweight syntax often seen in a dynamic language like Python. This gives your F# programs a lightweight, math-like feel.
let data = (1,2,3)
let rotations (x, y, z) =
[ (x, y, z);
(z, x, y);
(y, z, x) ]
let derivative f x =
let p1 = f (x - 0.05)
let p2 = f (x + 0.05)
(p2 - p1) / 0.1
let f x = 2.0*x*x - 6.0*x + 3.0
let df = derivative f
System.Console.WriteLine("The derivative of f at x=4 is {0}", df 4.0)
When run, this program will print: “The derivative of f at x=4 is 10”
Parallel and Asynchronous Programming
.NET Framework 4 and Visual Studio 2010 contain great libraries and tools for easy parallel application development. F# complements this with language features designed to make parallel and asynchronous programming more intuitive. This includes fundamental language features like immutability and first-class functions, and powerful programming models, such as asynchronous workflows, which let you write asynchronous code in the same linear style as the synchronous code you are used to.
let http url =
async { let req = WebRequest.Create(Uri url)
let! resp = req.AsyncGetResponse()
let stream = resp.GetResponseStream()
let reader = new StreamReader(stream)
let! contents = reader.AsyncReadToEnd()
return contents }
let sites = ["http://bing.com"; "http://microsoft.com";
"http://msdn.com"; "http://msnbc.com"]
let htmlOfSites =
Async.Parallel [for site in sites -> http(site)]
|> Async.RunSynchronously
Integrated with Visual Studio 2010 and .NET 4
F#’s integration in Visual Studio 2010 includes project templates, IDE support, IntelliSense and integration of the F# Interactive tool window. F# can be used to develop applications and components targeting .NET 2.0 through .NET 4 and Silverlight. As a .NET language, F# can be used comfortably alongside C# and Visual Basic.NET. And in .NET 4, core types that F# uses, such as Tuple, Lazy, and BigInteger, are now part of the .NET Framework and can be used across all .NET languages.
The F# Interactive tool window enables an explorative development style within Visual Studio. Below you can see the F# source code for an F# script open in the Visual Studio editor and the F# Interactive tool window where code is executed interactively. At the top right is the Form and graphics that the script has created.

Units of Measure
One ground-breaking feature of F# is Units of Measure, which allows you to annotate your floating point code with units, such as meters and seconds. This is simple to do, and errors will be reported during development when code combines units incorrectly. This provides compile-time checking of the correctness of floating-point code without sacrificing performance.

That’s a quick look at just a few of the exciting features of F#. For more on F#, visit the F# Development Center on MSDN.
Namaste!
The launch of Windows 7 is just around the corner. Whether you prefer managed or unmanaged development, you can take advantage of Windows 7 features with new APIs and libraries to make your application shine.
Multi-Touch
Touch-based interfaces allow users to interact with applications in a more intuitive way. Windows 7 introduces multi-touch input and manipulation processing through Windows Touch.
For native C++ developers, MFC now supports using a touch-enabled interface. MFC will do much of the heavy lifting: it listens for touch-related messages from Windows and calls out to a number of virtual functions to handle them. Developers merely need to register for touch input, set the gesture configuration, and override these virtual methods as required to touch-enable their application.
WPF 4 includes object model additions for touch interfaces so managed code developers can easily add touch support to their applications as well. Multiple finger input will be exposed through existing and new input events, while new manipulation and inertia events will be exposed for developers to consume.
Ribbon
Adding a Ribbon to your application can help organize your commands, tasks, and menus in a friendly way that makes it easier for your customers to find what they’re looking for. Whether your application is written in Win32, MFC, or WPF, new controls and APIs will help you add a Ribbon to your application.
If you write Win32 applications, the Ribbon framework provides a set of APIs for creating a Ribbon for your application. You can find out more about the Windows Ribbon Framework for Win32 here.
Visual Studio 2008 SP1 added support for an Office “look and feel” Ribbon UI to MFC applications. Visual Studio 2010 adds “look and feel” support for the Windows Ribbon, including an MFC Ribbon designer to make creating and editing ribbons much easier. An XML format for persisting Ribbon designs simplifies UI development by removing the need to “design in code”.
The new WPF Ribbon Control will be released out of band around the same time as WPF 4 through the Office UI Licensing site. You can find instructions on downloading the WPF Ribbon (currently in Preview) here. The WPF Ribbon will feature skins for Windows 7 and Office and all the standard Ribbon features that users are familiar with, including tabs and groups, dynamic resizing, quick access toolbar, application menu, contextual tabs, key tips, and more! The Ribbon will remain available as a separate, standalone assembly.
Location
Windows 7 features the Location platform, which makes it easy to write applications that can make use of the user’s location. The Location platform opens the doors to some interesting application scenarios – especially on mobile computers. For example, a location-aware application might use the current location to show the user nearby restaurants or shops, or an instant messaging or email application might tag messages with the sender’s location.
The Location platform provides a way for location devices, such as GPS and WWAN radios, to integrate with Windows and includes an API that applications can use to determine the current location of the computer. Because the Location API exposes its functionality through COM interfaces, C++ programmers and scripting language programmers alike can take advantage of it. The Windows 7 SDK includes samples and documentation to help you build location-aware applications. Find out more about the COM Location API on MSDN.
In addition to the COM Location API, .NET Framework 4 will include built-in managed APIs for location, making it easy for .NET applications to take advantage of Windows 7’s location capabilities.
Shell Integration
Windows 7’s Shell enhancements empower application authors to provide a richer integrated user experience. Jump Lists provide access to contextual startup tasks and files available to the applications. For instance, right-clicking on the Outlook icon will show the mail messages you’ve recently opened in the Jump List:
The new taskbar is less cluttered and can convey more information at a glance. The taskbar allow you to pin any program to the taskbar or rearrange the icons on the taskbar by clicking and dragging. Aero thumbnails, which appear when you hover over an icon in the taskbar, support view customization and user commands. Below is an Aero thumbnail that supports commands for controlling media playback.
MFC adds support for new Windows 7 shell features. By default, files opened by an MFC application through the “File Open” dialog will be added to your recent files Jump List. If you wish to override the default behavior, MFC also provides APIs that allow you to customize the contents of your application’s Jump List. MFC has also added support for High DPI and many of the new Windows dialog features. Below, the Open File dialog has been customized with additional controls:
Adding MFC support for Search, Preview and Thumbnails was an obvious choice. Now you can search your MFC documents in Explorer’s search field and see Icons and Previews just like Office applications.

If your application’s installer needs to access or update files that may be locked or in use, Restart Manager can handle application shutdown and restart, or eliminate or reduce the number of system restarts required for an install. With just a few lines of code, you get full Restart Manager support with automatic timed backup of currently opened documents. MFC has added support for the Transactional File System in ATL as well.
These new MFC features will be available in Visual Studio 2010. To take advantage of some of these features (such as Jump Lists), you will only need to recompile to get the updated user experience, while for others (such as Windows Touch or Restart Manager support) you will need to add a few lines of new code to incorporate new functionality.
WPF 4 allows you to use Windows 7’s new Shell features in your WPF applications as well. WPF 4 integrates Windows 7 Jump List functionality, including Tasks, Items, Recent and Frequent Lists, and Custom Categories. Windows 7 taskbar integration in WPF 4 includes progress bars, overlay icons, thumbnail buttons with command support, description text, and Desktop Window Manager (DWM) thumbnail clipping.
Learn More
This is just a taste of the ways you can build great Windows 7 applications. For more information, visit the Windows Team Blog and MSDN’s Windows 7 Developer Guide.
Namaste!
Sometimes, we get caught up in what we are currently doing, the day-to-day stuff, the impending deadlines and the like. Once in a while, it is good to take a step back and reflect upon the jounrey - the why, the what, the how and the where.
Recently, I got such an opportunity when I got a call to come in for a video-shoot for the Visual Studio documentary. I wasn't sure what to expect or what the end product was going to look like but given my epxerience with Channel 9 from the past, I said let's take a bet and do it. It was fun doing it.
The team completed this project recently and earlier today posted the Visual Studio documentary (part 1 and part 2) up on Channel 9.
I found it interesting particularly to hear from some of my colleagues including Anders Heljsberg, Dave Mendlen, Jason Zander and Scott Guthrie who all have been a part of this product line for a long time. Hope you find this enjoyable.
Namaste!
The web has dramatically changed the software industry over the past 15 years. Today it’s hard to imagine business without the web. Nearly all businesses have or are creating a presence on the web to promote or sell their products and services, find new customers, or support existing ones. At the same time, the web has spawned a massive new ecosystem of web professionals – developers and designers who are focused on helping these businesses thrive.
Many businesses, particularly small businesses, face the challenge of how to start building their web projects. That’s why I’m excited to announce the availability of the WebsiteSpark Program, a new program designed to help jumpstart web development and design for companies of up to ten members. As the latest offering in the ‘Spark’ family, including BizSpark and DreamSpark, WebsiteSpark builds on the legacy of these successful programs to provide software, support, and opportunities for web professionals everywhere.
Although Microsoft has always encouraged small companies to use our technologies, we’ve found that there was market gap in the area supporting small web consulting and hosting companies. About 5 months ago we conducted a survey of over 200 web professionals on both Linux and Windows platforms, and this gap was glaring; although many companies offer similar programs with “free software” or “free/community support,” we discovered that what these companies really wanted – and needed – was the ability and network to help drive business to their companies. Given our commitment to web developers who work in all types of organizations, we added WebsiteSpark to our portfolio to help these companies be more successful.
With WebsiteSpark, eligible companies can receive design and development software licenses and processor licenses with no up-front costs. In addition, they will receive support and training, as well as access to a broad marketplace that enables them to connect with prospective customers worldwide and feature their offerings in Microsoft marketing vehicles. The marketplace portal will be available later this fall.
In a nutshell, the WebsiteSpark Program makes it easier for companies to access and build on the Microsoft Web Platform, which offers web developers and designers around the world a robust environment for innovating on the web.
That’s why, in conjunction with today’s announcement on the WebsiteSpark program, I am also announcing the release of Web Platform Installer 2.0 and Windows Web App Gallery 2.0.
This release of Web Platform Installer simplifies installation and includes new additions such as IIS Media Services and the Windows Azure SDK. Coupled with the App Gallery, developers can also access dozens of free, open source, and ready-to-install applications to help build their websites. Today more than 20 new apps are available from both Microsoft and the community, including new additions Moodle and Sugar CRM alongside other popular web applications such as WordPress, Drupal, DotNetNuke and many more.
For more information about the WebsiteSpark Program, including who is eligible, visit www.microsoft.com/web/websitespark.
You can download Web Platform Installer 2.0 and Windows Web App Gallery at http://www.microsoft.com/web.
Namaste!
AJAX web applications bring a variety of rich user experiences to the web, but often those experiences require downloading a lot of code. The result is applications that are frustratingly slow to load and taxing to web servers.
Today we are announcing the availability of Doloto on MSDN DevLabs. Doloto is a tool that makes pages more responsive by decreasing the initial download size of complex AJAX web applications.
Doloto analyzes AJAX application workloads and automatically performs code splitting of existing large web applications. Doloto enables applications to initially transfer only the portion of client-side JavaScript code necessary for application initialization. The rest of the application’s code is replaced by short stubs; their actual function code is transferred lazily in the background or on-demand on first execution. Since code download is interleaved with application execution, users can start interacting with your web application much sooner without waiting to download code that implements features they’re not currently using.
How it Works
Doloto is a standalone client-side tool. Its wizard guides you through the following three steps:
1. Doloto profiles your application. Doloto performs profiling by running a local proxy on your machine that intercepts JavaScript files and instruments them to capture timestamps at runtime for every JavaScript function in a browser-independent manner.
2. Profiling information is used to calculate code coverage and a clustering strategy. This determines which functions are stubbed out and which are not and groups functions into batches which are downloaded together, called clusters.
3. Doloto rewrites JavaScript code. It then saves it to disk so that you can upload it to the server. The entire process happens on your machine, without needing access to the server. This way, you can profile and optimize the JavaScript of a any third-party site without special access to their servers. When you are satisfied with Doloto’s results, you can deploy the rewritten files to the server.
Show Me Some Results!
In our experiments across a number of AJAX applications and network conditions, Doloto reduced the amount of initial downloaded JavaScript code by over 40%, resulting in startup often faster by 30-40%, depending on network conditions. The chart below shows savings in the amount of downloaded JavaScript code across a range of popular web sites required for the initial application loading phase.
Download and try Doloto today, and share your thoughts and experiences on the project’s forum.
Namaste!
Designing new functionality on existing applications can be daunting. There are always differences between the original design and the current implementation.
The new Architecture tools within Visual Studio Team System 2010 help you understand the application you have, design new functionality you need, and validate that your design and your implementation do not deviate.
Understanding What You Have
Understanding the dependencies between parts of your application can be critical to determining where you may have problems. Additionally, having a visual graph can help you find the best place to implement new functionality.
You can get a big picture view of your solution by assembly, namespace, class or a custom filter in a Directed Graph Markup Language document (DGML) using the Generate Dependency Graph feature:

The DGML document generated from your solution can be visualized as a Dependency Matrix, Force Directed Layout, or as a Top to Bottom layout, as shown below. Each view can provide a different take on the structure of your project.

This high-level view is a great way to understand the overall shape of your architecture, but understanding the dependencies for an area you need to change can make the difference between a fifteen-minute change and a one-hour change. For instance, being able visualize the relationships around the Cart class can be very helpful in making changes to the shopping cart:
Another valuable way of understanding how your application works is to be able to visualize the sequence of calls that happen in key sections of your application. The Generate Sequence Diagram function, available in the code editor, will give you a view of the method calls your application makes. Below, you can see the sequence of calls that make up the Add method implementation within the shopping cart.
Designing New Functionality
Now that you have a more complete understanding of your existing application, you are in a better position to add functionality. Collaborating on design requires communicating in a standard way. Unified Modeling Language (UML) diagrams allow you to express your design in a way that others can understand. For instance, you can build UML Component and Class diagrams that describe the existing structural elements of your design, then add new elements to the diagrams to illustrate and document your changes. Below is how a completed Component diagram might look:

A Class diagram might look like this:

The Use Case diagram below enables teams to better understand and agree on the functions of the application.
Once you have a UML diagram, you can create or link designer elements to work items within Team Foundation Server’s (TFS) Work Item Tracking system.
Ensuring Application Validation
Over time, the code quality of a project can degrade if bug fixes and new feature implementations are not done with overall architecture in mind. This is where the Layer designer and Layer validation can help. The Layer designer enables you to define the logical layers and valid communication paths between layers of your project. Once you have associated assemblies, namespaces, and classes with layers in the Layer diagram, you can validate existing or new code against the layering constraints. For example, in this Layer diagram, it is valid for software within the Presentation layer to have dependencies on software within the Business Logic layer. However, since there is not a dependency line between Presentation and Resource Access, any software that attempts to take that dependency would cause a compile-time violation in the Error List.

You can validate layer constraints from the designer surface, command line, or from within the build process. Team Build’s gated check-in process ensures that layer constraint violations never make it into source control.
These are some of the features in Visual Studio Team System 2010’s architecture tools. You can get more information about these and other features at Cameron Skinner's blog.
Namaste!
Choosing a programming language is a personal choice that each programmer gets to make. It is akin to choosing a flavor of ice cream - there are many great options out there, but your favorite flavor is a matter of personal preference.
In Visual Studio 2010, we’ve made several enhancements to our two most popular languages, Visual Basic and C#, to give programmers all the tools they need to build great software no matter which language they prefer.
Visual Basic
The Visual Basic team focused on adding productivity features to the language so developers can get more done in fewer lines of code. The most common customer request for Visual Basic is to remove the underscore (“_”) character when breaking a code statement across multiple lines in most cases. Visual Basic 10 introduces implicit line continuation, which removes the need for the underscore character in most cases.
Function Filter(
ByVal customers As List(Of Customer),
ByVal orderCount As Integer
)
Dim query =
From c In customers
Where c.Orders.Count >
orderCount
Select c
Another new productivity feature is auto-implemented properties. With auto-implemented properties, lines of boiler-plate property implementation code can be replaced with simple one-line declarations. Previously, property declarations often looked like this:
Private _FavoriteFlavor As String = "Butter Pecan"
Property FavoriteFlavor() As String
Get
Return _FavoriteFlavor
End Get
Set(ByVal value As String)
_FavoriteFlavor = value
End Set
End Property
Private _FlavorList As New List(Of Flavor)
Property FlavorList() As List(Of Flavor)
Get
Return _FlavorList
End Get
Set(ByVal value As String)
_FlavorList = value
End Set
End Property
Now property declarations can be declared much more simply:
Property FavoriteFlavor As String = "Butter Pecan"
Property FlavorList As New List(Of Flavor)
Collection initializers and array literals are simpler as well. Collections can now be initialized when they’re declared, and the type of array literals is inferred by the compiler.
Dim toppings = New List(Of String) From
{
"sprinkles",
"chocolate chips",
"strawberries"
}
Dim cones = {"sugar cone", "waffle cone"} 'the type String() is inferred
Visual Basic 10.0 now has better support for lambdas. Lambdas can now contain expressions that don’t return a value, as the Sub keyword indicates below:
Array.ForEach(toppings, Sub(n) Console.WriteLine(n))
Sometimes you’d like to do more complex work inside a lambda declaration. Visual Basic 10.0 supports multiline lambdas. The compiler will infer parameter and return types where possible just like in regular lambdas.
Dim doubleDown = Function(n As String)
If n.StartsWith("s") Then
Return "extra " & n
Else
Return n
End If
End Function
Interoperating with dynamic language code such as Python and Ruby has become simpler in Visual Basic 10.0. For example, the following code snippet calls a method defined in a Python library “math.py”:
Dim mathLib As Object = python.UseFile("math.py")
Dim firstNumber = 44.2
Dim secondNumber = 9.5
mathLib.PowerOf(firstNumber, secondNumber)
C#
C# 4.0’s major themes are interoperability with dynamic programming paradigms and improved Office programmability. Dynamic lookup, a new feature in C# 4.0, allows you to use and manipulate an object from IronPython, IronRuby, JScript, the HTML DOM, or a standard .NET library in the same way, no matter where it came from. Language enhancements such as named and optional parameters and improved support for COM clients give C# developers who are working with Office APIs the same great experience that Visual Basic developers have enjoyed.
Adding the new dynamic keyword to your code allows its type to be resolved dynamically at runtime rather than statically at compile-time. This allows dynamic languages to expose their objects to C# in a way that feels natural to a C# programmer:
dynamic dynamicObject = GetDynamicObjectFromRuby();
dynamicObject.Foo(7);
dynamicObject.Property = "Property value";
dynamicObject[0] = "Indexed value";
Optional method parameters are familiar to Visual Basic and C++ programmers and are now available for C# programmers. Optional parameters are declared with a default value in the method signature, as follows:
private void CreateNewStudent(string name, int currentCredits = 0, int year = 1)
The method above can be called in any of the following ways:
CreateNewStudent("Chloe");
CreateNewStudent("Zoe", 16);
CreateNewStudent("Joey", 40, 2);
To omit the currentCredits parameter value but specify the year parameter, the new named arguments feature (highlighted) can be used. All of the following are also valid calls:
CreateNewStudent("Jill", year: 2);
CreateNewStudent(name: "Bill", currentCredits: 30, year: 2);
CreateNewStudent("Will", currentCredits: 4);
Named arguments are also a great way to write self-documenting calls to your existing methods, even if they don’t use optional parameters.
Learn More
Find out more about Visual Studio 2010’s language enhancements and download samples on the VB Futures site and the C# Futures site. To play with the new features, download and install Visual Studio Beta 1, then join the conversation.
Namaste!
Any time a programming model is introduced, developers need robust tooling support for learning, writing, debugging and optimizing their code to make use of it. This is particularly true for parallel programming, which adds a set of new variables to the equation.
Visual Studio 2010 has made great strides in the parallel debugging experience. Many features are also available as add-ins for Visual Studio 2008. Here’s a brief tour of the parallel programming, debugging, and diagnostic features available in Visual Studio 2008 and upcoming in Visual Studio 2010.
Debugging
Although Visual Studio 2005 had a simple built-in debugger for MPI programs, it did not provide a full “F5” experience. The new add-in for Visual Studio 2008, which is also integrated into Visual Studio 2010, allows you to select a cluster head node, how many cores you want, and hit F5 to debug your MPI program.

In addition to the great core work that the debugger team has done, Allinea, a leader in parallel debugging technologies, has ported their environment to Visual Studio. Allinea’s add-in enables even further streamlined MPI-specific debugging, including rank based context switching, group-wise step, pause, and run, parallel stack view, and lamination. Below is Allinea’s MPI debugging environment:
Service Oriented Architecture Debugging
One of the key new programming models introduced in Windows HPC Server 2008 was Cluster SOA, built on WCF with advanced scheduling and load balancing provided by HPC’s scheduler/broker. Up until now, debugging Cluster SOA was limited to basic WCF/.Net style debugging with no cluster integration. In Visual Studio 2010, an add-in for Cluster SOA enables the SOA Settings tab, allowing you to choose a head node, debug nodes and services, deploy runtime libraries and clean up automatically. Here’s a peak at the new SOA debugger in Visual Studio 2010:
Profiling
Integrated MPI-aware profiling was not available in Windows Server HPC 1.0. With Windows HPC Server 2008, tools such as XPerf enabled MPI profiling as well as system-level profiling and troubleshooting. But even XPerf really didn’t know much about the details of MPI message traffic, and no message traffic viewers existed. Since then, Vampir, the premier MPI message traffic viewer, has been ported to Windows and fully integrated with ETW. Vampir allows you to troubleshoot message ordering and delays. Various open source HPC tools are available as well, such as JumpShot, a free Java-based MPI message viewer.
Often times, the built-in VS Profiler can offer insight into performance issues. In Visual Studio 2010, this capability has been fully integrated with the HPC job scheduler to help analyze the behavior of a particular MPI rank or node. The Visual Studio MPI profiler shows line-level profile information, including a temperature view of execution, side-by-side with source view:
The profiler also shows a comparison report across multiple runs or builds so you can easily see the effect of your changes.

MPI Runtime Analysis
Beyond debuggers and profilers, sometimes you need specialized analysis tools to help with the complexities of large scale parallel programs. HLRS/ZIH at Stuttgart, a leading institute in Germany, has ported Marmot, their dedicated MPI analysis tool, to Visual Studio 2008. Marmot can be used to check the validity of parameters passed to MPI calls and detect irreproducibility, deadlocks, and incorrect management of resources. Below is Marmot in action:
From Printf to Integrated Profiling and Debugging
In a world where printf-style debugging was the norm not long ago, state-of-the-art debugging and profiling tools have taken a major step forward.
From within Visual Studio, you can debug and profile native as well has high performance MPI and Cluster SOA applications that scale from hundreds to thousands of cores. You can use XPerf and ETW to get a truly holistic view of the application in the context of the whole system. The new multi-core profiling and debugging tools that were introduced in Visual Studio 2010 can be effectively used on a cluster at the node-level as well.
Visual Studio is becoming a rich and productive environment for writing parallel programs of all types. To find out more about Windows HPC programming models, visit the Windows HPC Server Developer Resource Center. You can find a suite of samples that use various parallel programming models on the CodePlex Parallel Dwarfs site.
Namaste!