About the Author

John Bowen is a Lead Software Engineer with InterKnowlogy. In this role he both develops software and provides technical leadership for large scale projects with larger teams, usually in the areas of WPF, Silverlight and Surface. These include projects which have been the subject of Microsoft case studies and received awards for technology innovation. John is also a Microsoft MVP for Client Application Development and provides training for both clients and at community and Microsoft sponsored events across the U.S. John has been writing software since majoring in computer science at the University of Southern California and at Boston University where he graduated in 2001. He has also pursued an interest in computer graphics since high school, where he won awards for both still and motion graphics. Before joining InterKnowlogy he also worked creating software for the printing and health care industries and writing public facing web and ecommerce sites.

Blend for Visual Studio 2012 Platform Errors

With the recent release of Visual Studio 2012 Update 2 there is finally a real release version of Blend that can support WPF projects on .NET 4.5 in the form of Blend for Visual Studio 2012 (installed with the VS update package). Unfortunately there is a nasty and obscure error that can come up unexpectedly in applications that work fine in Visual Studio and at runtime.

The issue manifests as the dreaded Invalid Markup screen:

clip_image001

and a series of errors in XAML of the form “X is not supported in a Windows Presentation Foundation (WPF) project.” for every element in your project’s XAML:

List of Blend design surface errors from incorrectly unsupported elements.

The cause of the issue is a problem with how Blend loads solution configurations. Continue reading

Presentation Materials for Boston Code Camp 19

Thanks to everyone for coming!

A Survey of Multi-threading in .NET 4.5: Slides | Sample Code for all 6 libraries | More Samples for Async/Await

Reactive Extensions: http://msdn.microsoft.com/en-us/data/gg577609
TPL Dataflow: http://msdn.microsoft.com/en-us/devlabs/gg585582
Async Targeting Pack: http://www.microsoft.com/en-us/download/details.aspx?id=29576

Mixing TPL Dataflow with Reactive Extensions

The TPL Dataflow Library (TDF) from Microsoft DevLabs provides an additional method of managing asynchronous execution in .NET. Fortunately, like many of the other choices, it’s built on the same underlying constructs (primarily the Task object), allowing integration with existing solutions. One of the points of integration is provided by the IObservable and IObserver interfaces which form the basis for the Reactive Extensions.

The basic concept of TDF involves chaining together blocks that do some processing on each data item as it flows through the chain. Blocks can be sources (ISourceBlock) or targets (ITargetBlock) or a combination of both (IPropagatorBlock).

The most straightforward combination of Rx and TDF involves transforming the output of a source block into an observable sequence Continue reading

Unit Test filtering for TFS builds using Test Explorer in VS 2012

One of the major new features in Visual Studio 2012 is the Text Explorer tool window, which consolidates 2010’s Test View and Test Results windows and adds support for using different testing frameworks together in one place. There are definitely some positive aspects to Test Explorer in comparison to its predecessors, but as a completely new piece of functionality it unfortunately left out some key features that were previously available.

One of the places it fell short was in filtering of tests to enable running a specific subset of the tests in your solution, especially when working with a set of tests set up for TFS’s Team Build. When working with small sets of tests it could be a minor annoyance, but working with hundreds or thousands of tests made it basically unusable. Thanks to Visual Studio’s new release model of frequent updates, these shortcomings are already starting to be addressed with November’s Update 1.

The preferred method of specifying tests to run with builds in TFS is by using attributes on test methods, specifically the Priority and TestCategory attributes. VS2010’s Test View displays a configurable grid listing all available tests in the open solution.
image

Continue reading

Presentation Materials for Boston Code Camp 18

Great event at a new location! I hope everyone enjoyed it.

A Survey of Multi-threading in .NET 4.5: Slides | Code

Future-proofing your XAML Applications with Portable Libraries: Slides | Code

Portable Libraries Hands-On-Lab: http://tinyurl.com/plibhol
Reactive Extensions: http://msdn.microsoft.com/en-us/data/gg577609
TPL Dataflow: http://msdn.microsoft.com/en-us/devlabs/gg585582
Async Targeting Pack: http://www.microsoft.com/en-us/download/details.aspx?id=29576

Make Portable Libraries Your Go-To Project Template

With the upcoming release of Visual Studio 2012, Portable Libraries will finally be built into the product. The 2012 iteration of Portable Libraries is much improved from the prior versions, adding not only new platforms (Windows 8 Metro) but greatly increasing the list of available framework library classes that can be used across the various platforms.

Continue reading

Presentation Materials for San Diego Code Camp

Thanks to everyone for another great Code Camp!

Future-proofing your XAML Applications with Portable Libraries: Slides | Code

A Survey of Multi-threading in .NET 4.5: Slides | Code

Visual Studio 11: http://www.microsoft.com/visualstudio/11/en-us/downloads

Portable Libraries Hands-On-Lab: http://tinyurl.com/plibhol

Reactive Extensions: http://msdn.microsoft.com/en-us/data/gg577610

Presentation Materials for New England Code Camp 17

Thanks to everyone for coming!

What’s new in Visual Studio 11: Slides | Code
Check the slides for the list of all of the new Visual Studio features we looked at.

Easy Async in .NET 4.5: Slides | Code (for VS11 Beta)
The only code demo we didn’t get to look at can be found in the AddingAsync page, which shows a progression of converting a more complex 2 step data loading process from fully synchronous to fully asynchronous including cancellation and exception handling.

My favorite new features in VS11 Beta

After having a week to work with the new Visual Studio Beta, I’m already missing some of the new features when I need to jump back over to 2010. Here are some of my favorites, in no particular order.

Quick Find

image
This is a frequently highlighted new feature, and I’ve definitely found it useful already as a quick shortcut for getting to almost any function in the IDE. My favorite part of it is that it’s so keyboard focused and allows me to skip reaching for the mouse to do things that I would normally just dig into a menu for. As a longtime SlickRun user, the keyboard shortcut to activate it also feels really natural (SlickRun uses Win+Q, Quick Find is Ctrl+Q) and the fast auto-complete search feels similar too.

Incremental Search feels right again

image
Although much of the new functionality was available previously through the Power Tools, a few of the things that got pulled in finally got that extra polish that makes them just feel right. One of the first Power Tools that I had turned off was the new unified Find box that took over a bunch of different functions and keyboard shortcuts. The big problem I had was the way it handled Ctrl+I incremental search. I use this so frequently that it’s a reflex and there were a few hiccups in keyboard focus that caused me to have to stop and figure out how to get back to the state I wanted to be in in the editor. Now, in the beta, this experience has been smoothed out, and the only noticeable difference from the old Ctrl-I functionality are the new visual cues: the box up top showing what I’ve typed, the extra highlighting of all matches in the current window, but the keyboard experience feels the same, and responds just like I expect.

Navigate To (Ctrl+,)

image
One of the things I miss most when working in a bare instance of Visual Studio that doesn’t have my two favorite extensions installed (CodeRush and ReSharper) is quick keyboard navigation to any type in my solution. The new Navigate To window provides a similar (though not identical) experience, with a search while typing listing of types and members, including camel casing caps shorthand, and instant navigation to the selected item.

Out of process solution load and build

This one is pretty obvious, but I know a lot of work went into this and it’s going to be such a dramatic time and frustration saver. Finally those extra cores are getting used on the big workloads.

TFS Local Workspaces

So many cool things about this, and I’ve only scratched the surface so far, but just the way this has been worked into the UI is really impressive. Like if you need to switch back and forth between Local and Server workspaces, there’s one button to click. Doing a Compare to the workspace version of the file just works the same, but doesn’t need to talk to the server at all, so is much faster. No more worrying about accidentally changing a file from outside VS and getting out of sync – now VS is watching and will pick up the change for you. Just all around a well thought out experience and hits a lot of the big annoyances people have with using TFS source control.

New Diff tool

Finally, the Visual Source Safe compare window is gone. A lot here is similar to other diff tools that you could previously point TFS to for your comparisons, but being built in not only skips that extra configuration, but also gives you the full VS editor. Editing a file right in the compare window with full syntax highlighting, Intellisense, and even instant updates of the compare state feels like magic after so much time spent with the old one. The UI isn’t the only part that’s changed either. TFS auto-merging is much improved too and should cut down dramatically on the number of times you even see the merge window.