You are on page 1of 36

special repor t

February 2010 www.greymatter.com/visual studio

Visual Studio 2010


Tools to set your ideas free

grey matter :: special report


A Supplement for Software Professionals
Tools to set your ideas free

4// Overview of Visual Studio 2010 •1991.


I remember my first sight of Visual Basic in
Although the language was interesting,
6// The User Interface much more significant was the form designer
where you could build a user interface by simply
8// Inside .NET 4.0 dragging and dropping controls from a palette,
generating event handlers automatically. Visual
12// Web development Basic rapidly gained in popularity, spawning an
16// Cloud development industry in third-party controls and add-ons.
Visual Studio 97 was Microsoft’s first
18// Microsoft Office development attempt at a single development environment
for multiple languages, although Visual Basic
20// Parallel development retained its own environment. Then came .NET,
which appeared in Beta form in 2000. The
22// What’s new in languages brain-child of Anders Hejlsberg of Turbo Pascal
24// Lifecycle management and Delphi fame, .NET supported multiple
languages, including Visual Basic .NET and two
28// Vendor showcase new creations in C# and J# (Microsoft’s answer
to Java). Accompanying it was Visual Studio
32// Team System in practice .NET which brought them all into a single
environment for the first time.
34// Licensing and upgrading Visual Studio 2005 added Visual Studio
Team System, extending the toolset to
encompass more of the application development
Editor: Matt Nicholson lifecycle, and now here we are with Visual
Principal author: Tim Anderson Studio 2010, and another big leap forward. In
Design and layout: Jason Stanley
Front cover image: Getty Images
these pages you will discover how Visual Studio
Advertising: Ash Khagram, Anna Roach 2010 adds new languages in F# and through
Printing: Cambrian Printers, UK the Dynamic Language Runtime. In addition to
This supplement has been published in partnership with Windows and the Web, it contains tools and
Microsoft. All trademarks acknowledged. While all reasonable frameworks to target Microsoft Office and the
attempts are made to ensure accuracy, Grey Matter disclaims
any liability for any use of any information herein. Cloud through Windows Azure, and to take
advantage of the latest multi-core processors.
Copyright © 2010 Grey Matter Limited. All rights reserved. No
part of this publication may be reproduced in any form without
This really is a version to ‘set your ideas free’!
the prior consent of the copyright holder.

Grey Matter Limited


Matt Nicholson
Prigg Meadow
Ashburton
This supplement is based on Beta 2 of Visual
Devon TQ13 7DF, UK
Studio 2010, we will therefore be updating
Tel: 01364 654 100 these articles once the product is launched.
Fax: 01364 654 200
maildesk@hardcopymag.com Check www.greymatter.com/visualstudio
www.hardcopymag.com for the latest details.

FEB 2010 | Visual Studio 2010 www.greymatter.com/visualstudio //3


VISUAL STUDIO 2010
Tools to set your ideas free

Overview
This new version of Visual Studio brings you features
and tools that really will set your ideas free.

•first Inappeared,
the 13 years since Visual Studio
Windows development has
new Web-based help system which can derive
content either locally or from MSDN Online.
been transformed. There are new platforms Microsoft has taken the opportunity to
in Silverlight, ASP.NET and Ajax. Desktop introduce .NET 4.0 alongside Visual Studio
applications can take advantage of Windows 2010. As Tim explains, this is a major update,
Presentation Foundation (WPF), and it is even introducing new libraries and support for
possible to target your applications at the new languages. In particular there is a new
‘Cloud’ thanks to Windows Azure. library to support parallel programming which
Visual Studio has evolved to take is used by other .NET libraries to improve
advantage of these new platforms, and to performance on multi-core processors. Parallel
support new languages. It has also extended programming is also made easier by new
its reach by offering tools not only to write debugging and profiling tools that help you
code, but to assist in design, testing and even find out what is actually going on.
deployment. And then there are the new tools The Dynamic Language Runtime (DLR)
and frameworks to help you make the most of not only supports dynamic languages such as
the potential offered by the latest multi-core IronPython and IronRuby (available under the
processors. Microsoft Public Licence), but also dynamic
Over the next 28 pages, Tim Anderson features that have been added to other .NET
will be looking in depth at the main areas in languages such as Visual Basic and C#. There
which Visual Studio 2010 has something new is a new functional language in F#, which is
to offer, finding out what early adopters think based on ML, and there are enhancements to
of it, and what third-party suppliers are doing Windows Workflow (WF) which open up new
to support it. We will also be looking at your possibilities for application design.
licensing and upgrading options. Moving on to the construction of Web
Right from the moment you first open applications, Visual Studio 2010 offers
Visual Studio 2010, it is obvious that much many enhancements. In particular (and
has changed, as Microsoft has taken the unsurprisingly), it is designed to help you take
opportunity to re-build the user interface full advantage of the new features offered
around WPF 4.0. New features include the by Silverlight 4.0, with its support for COM
ability to float tools outside the main window, Automation, printing and extended range of
allowing you to make better use of wide or controls. Silverlight projects are supported
multiple screen displays, and a completely out-of-the-box.

4// www.greymatter.com/visualstudio VISUAL STUDIO 2010 | feb 2010


VISUAL STUDIO 2010
Tools to set your ideas free

IntelliTrace, which
comes with the Ultimate
edition, lets you examine
application state both
before and after the point
at which a bug occurred.

In addition to ASP.NET and Ajax, Visual lifecycle tools offered by Team System. All
Studio 2010 introduces a new framework in three editions, including Professional, come
the form of ASP.NET MVC which offers several with unit testing tools. There is also Team
advantages, particularly when it comes to Foundation Server Basic, which can be run on
testing and performance. the same machine as Visual Studio itself.
The Premium edition comes with a wider
Into the Cloud range of testing and profiling tools, while
Sticking with the Internet, Visual Studio 2010 the Ultimate edition adds advanced tools for
introduces support for Windows Azure, which design and modelling, with full support for
is Microsoft’s platform for the deployment of UML 2, together with Test and Lab Manager
applications ‘in the Cloud’, together with a which supports testing on virtual machines.
hosted version of SQL Server called SQL Azure. It also include IntelliTrace, which uses a
Working with Azure is made easier through trace log so that you can back-track through
the provision of what amounts to a local application state.
version against which you can develop and Even in these 36 pages we can only
test prior to deployment. scratch the surface of what Visual Studio 2010
Another important platform is Microsoft has to offer. However there is plenty here
Office, and here again this new version makes to ‘set your ideas free’.
life easier. SharePoint applications are much
easier to debug, and there are several new Find out more...
SharePoint project types. With regards to i Don’t forget that you can keep up to date
Microsoft Office, the new dynamic language with the latest developments by visiting
features make for a better fit with the Office www.greymatter.com/visualstudio.
The official Visual Studio 2010 site is
COM API, and there is a new visual designer
at www.microsoft.com/visualstudio/
for the Office Ribbon. products/2010/default.mspx.
Finally of course there are the application

Feb 2010 | TOOLS TO SET YOUR IDEAS FREE www.greymatter.com/visualstudio //5


VISUAL STUDIO 2010
Tools to set your ideas free

The user interface


Microsoft redesigns the user interface of Visual Studio 2010
using Windows Presentation Foundation.

•Studio
The first thing you notice is that Visual
2010 has a completely new look, and
is little changed from that in Visual Studio
2008. However the menus and command bars
there is a good reason for this as the product now use WPF, which is especially noticeable
has been re-built using Windows Presentation when you see the new and somewhat inferior
Foundation (WPF). According to Principal customisation dialog.
Software Engineer Paul Harrington, who Still, there are plenty of new features.
spoke on the subject at the 2009 Professional Among the most welcome is the ability to
Developer’s Conference, Microsoft made this float windows out of the main IDE. This is
radical change for three main reasons. One great if you have multiple screens: you might
was to “prove the capabilities of WPF 4.0”, a use one for a maximised editor window, for
technology which has been around since late example, and a second to display the other
2006 but is under-used by developers, both tools you are using.
within and outside Microsoft. In the process, Another is the ability to search the
WPF itself was substantially improved, as the toolbox. Click on the toolbox, start typing, and
Visual Studio team worked with the WPF team Visual Studio performs an incremental search
to fix bugs and solve problems. on your expression, including items that
The second reason was to enable new are currently collapsed. If there are multiple
features. Techniques such as zooming, matches, press tab to cycle through them.
graphical enhancements and visualisation fit Searching code is also improved. The new
naturally with WPF, and of course it is ideal Navigate To dialog lets you search a solution
for those working with WPF and Silverlight. and see results listed as you type. You can
The third reason was to improve the also use camel case abbreviations, so a search
architecture of Visual Studio, separating the for MM would find MyMethod. Navigate To
presentation from the business logic. is on the Edit menu, or ‘Ctrl+,’ if you prefer
Although the user interface is new, keyboard shortcuts.
under the covers Visual Studio has not been Zooming in the editor gives you flexibility
rewritten from scratch. Compatibility is to make the text very large, for example when
crucial, so there is extensive interop code for showing code at a meeting or presentation, or
integrating with native code and to continue to zoom out to see more code on the screen.
support of COM extensibility interfaces. Zoom can be controlled from the mouse or
Some of the designers are also the same. the keyboard.
The Windows Forms designer, for example, Generate From Usage is a time-saving

6// www.greymatter.com/visualstudio VISUAL STUDIO 2010 | feb 2010


VISUAL STUDIO 2010
Tools to set your ideas free

The ability to float


windows onto the desktop
is ideal for large or
multiple displays.

feature that also fits well with test-driven Parallel Stacks and Parallel Tasks.
development. In essence, it lets you reference Another neat feature relates to DataTips.
types, properties and methods that do not Developers now take for granted that they
exist, and generates corresponding stub code can hover the mouse over a variable during a
for you. In C#, for example, you could type: debug session, and get its value in a tooltip.
MyClass MyObj = new MyClass(); However, the value disappears when you
Presuming there is no such class, Visual move the mouse, unless you add the variable
Studio marks MyClass with a wiggly underline. to a watch window. In Visual Studio 2010
Click on it, and a small blue block shows the you can pin the DataTip so it stays on the
presence of a smart tag. Click the block, and screen throughout the session, and even add a
you get an option to generate the MyClass comment.
type. Visual Studio is highly extensible, and
A similar technique will generate can be used as a platform for Windows
properties and methods, with Visual development tools. The new Extension
Studio inferring argument types from Manager makes it easier to find and install
your usage. Generated methods throw a extensions. The online gallery lists what is
NotImplementedException, which is well available, complete with user ratings, within
suited for test-driven development since it is a Visual Studio window, so there is no need
good practice to design tests that fail initially, to visit a Web site. You can download and
before implementing the correct code. install an extension in a few clicks. Many of
There are many changes to the Visual them are free, or have both free and paid-for
Studio debugger. For example, the breakpoints versions.
window now lets you search, label, import and Finally, online help has been completely
export your breakpoints. There are new tools re-done. The new system is Web-based, with
for debugging parallel applications, including pages served either from a local embedded
a redesigned Threads window with search, Web server or from MSDN online, and the
grouping, filtering and new column types, and primary means of navigation is search,
new tool windows where you can work with rather than the old tree view.

Feb 2010 | TOOLS TO SET YOUR IDEAS FREE www.greymatter.com/visualstudio //7


VISUAL STUDIO 2010
Tools to set your ideas free

Inside .NET 4.0


Visual Studio 2010 coincides with the release of a
new version of the .NET Framework.

•sees The release of Visual Studio 2010 also


the release of version 4.0 of the .NET
have not been eliminated, but new features in
.NET 4.0 do reduce the burden on developers,
Framework. This is a major update. Versions who no longer have to deal directly with
3.0 and 3.5 extended rather than replaced threads.
version 2.0 and continued to use the 2.0 The heart of the new Parallel extensions
runtime. However 4.0 introduces a new is the Task Parallel Library (TPL). As its name
runtime. implies, the Task Parallel Library deals with
Visual Studio 2010 can also target older tasks rather than threads. It has its own
versions of .NET if required, and in general scheduler, and will use one or many threads
Microsoft has made a big effort to preserve to perform a task depending on how many
compatibility. One impressive new feature is processors are available. The new Parallel class
that multiple versions of the .NET Framework has methods Parallel.For, Parallel.ForEach and
can run side-by-side in the same process, for Parallel.Invoke which use the TPL. Instead of
example when managed code called a COM looping consecutively over the assigned tasks,
component that is itself written in managed they are performed in parallel to the extent
code, but with an older version of .NET. In the that is appropriate for the machine:
past this scenario might fail, but now both Parallel.Invoke( () => {Task1();},
assemblies will use the version with which () => {Task2();}
they were built. )
Note that some features of .NET 4.0, In this example, two three-second tasks
such as changes in ASP.NET and in specific are passed to Parallel.Invoke using lambda
languages, are covered elsewhere. expressions. Instead of taking six seconds to
execute, it will normally complete in three
Parallel Programming seconds on a machine with two or more cores.
It is widely accepted that multiple CPUs The TPL is used by other .NET libraries to
rather than faster CPUs are the way forward improve performance. The most prominent
for improving software performance. The example is Parallel LINQ (PLINQ), a parallel
implication for software developers is that implementation of LINQ to Objects. This
concurrent programming is vital when lets you use Language Integrated Query
performance is critical. The .NET Framework statements against any enumerable object and
has always supported multi-threading, but have it execute in parallel.
coding threads is complex and can lead to Parallel programming is also supported
subtle and unpredictable errors. These risks by new collection classes and primitive types

8// www.greymatter.com/visualstudio VISUAL STUDIO 2010 | feb 2010


VISUAL STUDIO 2010
Tools to set your ideas free

Code Access Security was too complex, many


of its settings were ineffective, and the fact
that it only applied to .NET code limited its
value.
Its replacement for administrators is
Windows Software Restriction Policies,
which apply to both .NET and native code
applications, and which is simpler to manage.
Within .NET itself, there is also the concept
Windows Presentation Foundation 4.0 has richer
graphics, among numerous other changes. of separating security-critical code, that
can potentially do damage, from security-
that handle synchronisation without the need transparent code that is safe. This model
to deal directly with locking code. Examples is called Transparency and it is used in
include BlockingCollection(T) and sandboxed environments. Code can be marked
System.Threading.Barrier. as transparent via attributes. This model was
The Visual Studio 2010 debugger lets you actually introduced in .NET 2.0 mainly for
inspect Parallel Stacks and Parallel Tasks with internal use, but now in .NET 4.0 has been
new tools, while the profiling tools let you enhanced and made more widely available.
visualise multi-threaded performance.
Overall, the concurrent programming Dynamic language support
support in .NET Framework 4.0 and Visual Included in .NET Framework 4.0 is the
Studio 2010 is among the most significant Dynamic Language Runtime (DLR), and
new features. The main caveat is that dynamic features have been added to .NET
developers still need to be aware of the kinds languages including Visual Basic and C#.
of bugs that concurrency can introduce, and The DLR supports dynamic languages such
incorporate that awareness into the test and as Python and Ruby, implemented for .NET
development process. as IronPython and IronRuby, and enables
interoperability between dynamic and static
Security languages.
When .NET was launched ten years ago, it Dynamic typing is also useful for COM
introduced a new approach to application Interop, where types may not be known until
permissions called Code Access Security, in runtime. It simplified working with COM
which the execution rights for .NET assemblies automation in Microsoft Office, for example.
were controlled by policies set through the The DLR is supported by a new
.NET Configuration Tool. Policies could be System.Dynamic namespace. This includes two
applied based on conditions, and execution classes, DynamicObject and ExpandoObject.
was permitted at various levels from full trust DynamicObject is a base class for creating
to completely disallowed. your own dynamic classes, which can include
Microsoft has moved away from Code classes that have both static and dynamic
Access Security to the extent that some of members. ExpandoObject is a class whose
its features are no longer supported, and it members can be added and removed at
is now turned off by default. This is because runtime. It can also be passed to other

Feb 2010 | TOOLS TO SET YOUR IDEAS FREE www.greymatter.com/visualstudio //9


VISUAL STUDIO 2010
Tools to set your ideas free

Coding for Windows


There are two frameworks for Windows desktop applications in .NET. Windows Forms
is the original, and remains supported though development has slowed. Windows
Presentation Foundation (WPF) is the newer framework, based on XAML mark-up and
compatible as far as possible with Silverlight.
WPF 4.0 is the version that makes it mature and fully usable. One factor is that Visual
Studio 2010 is itself built with WPF, and the interaction between the two teams resulted
in substantial improvements in areas including native code Interop and text handling
Graphic effects are faster and more powerful too. Cached composition lets you cache
content in video memory, and there are new Pixel Shader and Animation Easing features.
Layout rounding overcomes rendering artefacts on object edges.
Another key element is Windows 7 support. The launch of Windows 7 has
reinvigorated the upgrade cycle, and users of these machines will expect applications that
take advantage of its new features. Microsoft created these APIs with native code and
COM, but there are two routes to incorporating them into .NET applications.
One is the Windows API Code Pack which works with .NET 3.5 or higher and adds
support for the Taskbar, Windows 7 libraries and common file dialogs, task dialogs, the
sensor platform, and application restart and recovery. But if you use WPF 4.0 you might
not need the code pack. Support for the Windows 7 taskbar is built-in, including adding
items to Jump Lists, progress bars within taskbar icons, and adding controls to thumbnail
previews. There is also support for Windows 7 multi-touch, with events like TouchDown
and TouchMove, and Manipulation classes that let you respond to gestures.
Developers of business applications will find three new controls which match their
counterparts in Silverlight. These are the DataGrid, the Calendar and the DatePicker.
Windows developers should now think twice before starting a new Windows Forms
application. There are still reasons to do so, but WPF is much better at layout and scaling.
Another factor is Silverlight, which is essentially cut-down WPF and shares the same
design tool in Expression Blend. If there is a possibility of a transition to cross-platform
Silverlight, then starting with WPF rather than Windows Forms makes sense.

dynamic languages: use whichever approach they prefer or which


dynamic myobj = new ExpandoObject(); is best suited to the task.
myobj.forename = “William”;
myobj.lastname = “Smith”; Workflow and Communication
myobj.id = 34; Microsoft is placing a big emphasis on
The addition of dynamic features to the Windows Workflow (WF) in .NET 4.0, hoping
core .NET Framework is important not only for to move it more into the mainstream
interoperability, but also because it defuses of .NET development. In addition, WF is
the argument about the relative merits of becoming tightly integrated with Windows
static versus dynamic typing; developers can Communication Foundation (WCF), because of

10// www.greymatter.com/visualstudio VISUAL STUDIO 2010 | feb 2010


VISUAL STUDIO 2010
Tools to set your ideas free

the obvious synergy between workflow and applications for deployment in AppFabric.
messaging. Aside from WF integration, there are not
WF is essentially a runtime that knows so many changes in WCF, although it does
how to process activities, where activities are get support for WS-Discovery for dynamically
sequences that you define either in code or in discovering service addresses. There is also
the WF Activity Designer. The runtime is able simplified configuration, new framework
to persist its state, so that even long-running support for routing services, and better
workflows are handled correctly. Workflow support for REST (URL-based) services.
applications can be deployed in the IIS Web A common question is how the
server, as Windows services, or in SharePoint, combination of WF, WCF and AppFabric
or hosted by custom applications. compares to Microsoft’s high-end application
There are numerous changes to WF integration server BizTalk. The normal response
in this release, starting with a brand new is that AppFabric applications are intended
designer. You can also host the WF designer primarily for Microsoft platforms, whereas
in your own applications, enabling users to BizTalk handles interaction between Microsoft
customise workflows. Performance is another and non-Microsoft platforms. Nevertheless,
focus. The activity library has been largely there is some overlap and AppFabric is likely
rewritten. There is still a Sequence workflow, to handle some tasks that were previously
but a Flowchart workflow replaces the old in BizTalk’s realm with greater ease of
StateMachineWorkflow.
New built-in flow
control activities
including DoWhile, Pick
and ParallelForEach.
A number of built-
in activities support
WCF messaging, and
message activities
can be gathered into
transactional scopes.
There are also more
options when hosting
a WF application, Working with a Windows Workflow application in Visual Studio 2010.
the most significant
being Windows Server AppFabric (codenamed development and lower cost deployment.
‘Dublin’). This provides dedicated services According to consultant David Chappell,
for hosting both WF and WCF applications, “Microsoft is making the workflow way more
including databases and persistence support, attractive for a broader range of scenarios. Its
monitoring, messaging and the ability to days as a specialised player in the Windows
manage your application with either the IIS application development drama are drawing
manager or PowerShell. There are also Visual to a close. Windows Workflow is on its
Studio templates to enable easy packaging of way to centre-stage.”

Feb 2010 | TOOLS TO SET YOUR IDEAS FREE www.greymatter.com/visualstudio //11


VISUAL STUDIO 2010
Tools to set your ideas free

Web Development
Using Visual Studio 2010 to build rich Internet applications.

•development,
In the uncertain world of software
one thing is for sure: the
compared to its first implementation. Web
Forms have a couple of advantages. First, the
Internet is not going away. Web applications framework handles state management on
are inherently cross-platform, with minimal your behalf, making coding a Web application
deployment hassles and huge flexibility, while closer to the experience of coding a desktop
the advent of rich Internet applications (RIA) application. The values of fields persist
built with Adobe Flash or Microsoft Silverlight automatically when the page is refreshed.
blurs the boundaries between the desktop Second, the maturity of the framework means
and the Web. There are also advances in the excellent third-party support, so you can
ASP.NET platform which now comes in two easily find the components you need. Web
flavours: the old-style Web Forms for rapid Forms is an excellent framework for rapid
development, or the new ASP.NET MVC for development.
leaner code and greater testability. Web Forms gets some worthwhile
Microsoft’s RIA platform has evolved improvements in version 4.0. The first thing
rapidly, and Visual Studio 2010 is the first developers will notice is that new Web
version that fully supports and embraces it. It Application and Web Site projects contain
is not just about Silverlight. Developers who more code for getting started, though there
prefer pure HTML and JavaScript solutions is also an option for empty projects if you
have the benefit of both jQuery, the open like lean and mean. Web Application projects
source Ajax library, and the ASP.NET Ajax include membership support by default, for
library which works alongside jQuery and user management. Both project types include
provides both client-side controls and support master pages, jQuery Ajax scripts and CSS
for common tasks such as partial page classes so that you can quickly modify existing
updates. The new Visual Studio 2010 editor code to create a Web-designed basic Web
has IntelliSense support for JavaScript coding. application.
So what is the difference between these The most colourful new feature is the
three platforms, and what is new in Visual Chart control which lets you add a wide
Studio 2010? variety of 2D and 3D chart types to a
page, with a rich range of properties for
ASP.NET Web Forms customisation. The ScaleBreakStyle allows a
ASP.NET Web Forms is the original framework gap in the scale, for example: ideal for charts
for .NET Web applications, introduced at the with one or two values much higher than all
same time as .NET itself around ten years the others. There is also a logarithmic scale
ago, though of course now much enhanced available.

12// www.greymatter.com/visualstudio VISUAL STUDIO 2010 | feb 2010


VISUAL STUDIO 2010
Tools to set your ideas free

WCF RIA Services


Although it is the multimedia capabilities of Silverlight that have grabbed most attention,
in a business context the ability to securely access and update data is a higher priority.
WCF (Windows Communication Foundation) RIA Services, greatly simplifies this task,
and is integrated with the Visual Studio 2010 tools. RIA Services is not exclusively for
Silverlight, though it was developed with that in mind, but also works with other clients
including Web Forms, ASP.NET MVC and ADO.NET Data Services.
The heart of RIA Services is the DomainService class. In your server-side application
you write a DomainService class that interacts with data, either through Microsoft’s
Entity Framework or by some other means, and publishes operations for remote clients.
The RIA services tools then generate client proxy classes that let you call on those domain
services. These remote calls are asynchronous, so you pass a callback method as an
argument. This is what will receive the results. Use of RIA Services is not restricted to data
operations: any .NET class can be published and accessed remotely.
RIA Services provides an Authentication Domain Service that ties into the ASP.NET
Membership framework. On the client, this gives you access to a login method and a user
object, so you can write login and logout code and check the current user’s roles. On the
server you can set a RequiresAuthenticationAttribute or a RequiresRoleAttibrute on the
methods to be secured, ensuring that only permitted users can access them.
The ASP.NET Membership framework is integrated with Visual Studio wizards for Web
projects, so that Silverlight, ASP.NET and RIA services offers an end-to-end solution with
skeleton code for a complete authenticated application.

It is now easier to do fine-grained are generated for data-bound controls. The


management of view state (the hidden state result is HTML that is easier to work with on
data which is transmitted with a page) by the client, for rich AJAX applications.
disabling it for a page and then enabling it
for only those controls which need it. ASP.NET MVC
Another new feature is better framework Although Microsoft is continuing to evolve
support for page routing. This is the technique Web Forms, the framework is showing its age.
of mapping URLs to physical pages in order Web Forms by design wraps the Web model
to improve the usability of a site. You can set to make it somewhat desktop-like, but this
routing programmatically, or with declarative now counts against it among developers for
markup code. whom the Web has always been the primary
Web Forms also have better standards platform. The complex Web Forms page
support. You can specify that all server-side lifecycle along with the burden of view state
controls render markup that conform to data can get in the way.
XHTML 1.0 strict markup, making them easier ASP.NET MVC is Microsoft’s next
to style with CSS. A further improvement is generation Web framework. MVC stands for
that you can control how client-side ID values Model View Controller, an architecture in

Feb 2010 | TOOLS TO SET YOUR IDEAS FREE www.greymatter.com/visualstudio //13


VISUAL STUDIO 2010
Tools to set your ideas free

which the Model (behaviour and data) of an New features in version 2.0 include declarative
application is separate from the View (what form validation both on the server and on the
the user sees) and the Controller (managing client, asynchronous controllers for calling
the interaction). That said, studying MVC Web services with unpredictable response
theory may not the best way to get started times without blocking performance, and a
with ASP.NET MVC. Another way of looking technique called Areas which lets you divide
at it is as a lightweight framework based on an application into isolated sub-projects.
URLs and templates. In ASP.NET MVC, the URL When you start an ASP.NET MVC project
is not the address of a physical page, but user in Visual Studio, it prompts you to create a
input into the application. Handlers process test project at the same time. Visual Studio
the URL, extracting arguments, getting the also creates a skeleton application, including
results and feeding them into the templates. sample pages and ASP.NET Membership
One of the benefits of this approach is support. Working with ASP.NET MVC tends to
that it is more amenable to testing. Tests can be more code-oriented than with Web Forms,
easily simulate input and parse the results, but nevertheless it is possible to use ASP.NET
enabling test-driven development and more controls in MVC projects and the designer
reliable and maintainable applications. supports this.
There are also performance advantages.
The popular developer resource site Stack Silverlight
Overflow is one of the best-known public The debate is raging: as Web applications
ASP.NET MVC applications, and succeeded increase in importance relative to desktop
partly because of its fast response times, even applications, is it better to use advanced HTML
though it worked on just two machines. and JavaScript for a rich user interface, or
ASP.NET MVC has been adopted a plug-in that does its own rendering and
enthusiastically: “One of the great aspects code execution? Silverlight is Microsoft’s
of ASP.NET MVC is how lean and clean the implementation of the plug-in approach, and
architecture is - there is so little background its main competitor is Adobe Flash.
noise compared to WebForms,” says Howard Silverlight lets you create a Web
van Rooijen of EMC; while a recent paper on application using a cross-platform version
software development trends
from ThoughtWorks, a global
software development company,
lists ASP.NET MVC as a tool ready
for immediate adoption.
ASP.NET MVC is released
under an open source licence.
Version 1.0 appeared in March
2009. The new Visual Studio
2010 is therefore the first version
to be built with ASP.NET MVC
in mind, and comes with full
support for ASP.NET MVC 2.0. The new ASP.NET Chart control brings rich charts to Web applications.

14// www.greymatter.com/visualstudio VISUAL STUDIO 2010 | feb 2010


VISUAL STUDIO 2010
Tools to set your ideas free

This out-of-browser
application demonstrates
HTML content rendered in
Silverlight and converted
to a touch-control jigsaw
puzzle.

of Windows Presentation Foundation (WPF), with a visual two-way designer and several
driven by client-side .NET code written in Silverlight project types. A strong feature of
C#, Visual Basic, or other languages such as Silverlight projects is that you can seamlessly
Python. The Silverlight runtime is supported debug client and server code in the same
by Microsoft on Windows and Intel Mac, while solution.
an open source Linux version is maintained by Silverlight has progressed rapidly from
Novell’s Mono project. Silverlight is currently version 1.0 in September 2007 to Silverlight
installed on around 50 percent of computers 4.0 today. The latest release meets many
active on the Internet, according to figures feature requests and is the first that is truly
from RIAStats, and slightly more than that in ready for business use.
the UK. The plug-in is generally easy to install, Highlights in a long list of new features
though it may be blocked in some locked- include printing support, a RichTextBox
down business environments. with editing, localisation with bi-directional
There are several advantages to the text, improved databinding, Webcam and
Silverlight approach. First, it is a multimedia microphone support, embedded HTML and
player, ideal for video or animations. Second, access to the notification area when out of
it offers a rich and predictable surface for the browser, and the ability to read and write
designers, enabling elegant user interfaces files when running as a trusted application
that would be hard to achieve in HTML. Third, out of the browser. The range of supplied
the ability to run .NET code means both fast controls now includes business essentials such
performance and a familiar platform for as a DataGrid and DatePicker. With Visual
developers. Fourth, Silverlight can also run Studio 2010 the tooling is now mature, with
out of the browser as a desktop application, developer-oriented design support in the IDE,
and in the new version 4.0 has support for and compatibility with Expression Blend
COM Automation, widening the scope of for designers.
the runtime and enabling interaction with
Microsoft Office on Windows.
Find out more...
Silverlight is backed by WCF RIA Services, i ASP.NET MVC at www.asp.net/mvc/
a server-side framework which simplifies the Stack Overflow at
hook-up of a client application to data and http://stackoverflow.com
authentication (see panel). Visual Studio 2010 Silverlight at www.silverlight.net
is the first release to fully support Silverlight, RIAStats at http://riastats.com

Feb 2010 | TOOLS TO SET YOUR IDEAS FREE www.greymatter.com/visualstudio //15


VISUAL STUDIO 2010
Tools to set your ideas free

Cloud development
Using Visual Studio 2010 to develop for Windows Azure.

• Windows Azure is Microsoft’s cloud


platform for hosting applications. Instead of
‘Geneva’ and also in preview) or other Access
Control providers. The AppFabric Service Bus
deploying applications to your own servers, is a secure messaging service that integrates
you install them externally on Microsoft’s with Windows Communication Foundation.
Azure infrastructure. This removes the burden SQL Azure Data Sync, not part of
of maintenance and capital expenditure, and AppFabric, is another service in preview which
makes it much easier to scale to demand. synchronises Azure data to on-premise data
Azure has a pay-as-go model, so you pay an using the Microsoft Sync Framework for .NET.
hourly fee for compute ‘instances’, ranging This can both extend on-premises applications
from ‘small’ to ‘extra large’, where each to the cloud, and assist with caching Azure
instance is analogous to a virtual machine data locally for performance or offline use.
dedicated to running your application. In Windows Azure classifies applications into
addition, you pay for storage and data roles, of which there are currently two. A Web
transfer on a pay-as-you-go model, and a flat role installs into IIS 7 and ASP.NET, whereas a
monthly fee for SQL Server if you need it. worker role is for background processing and
Then there is Windows Server AppFabric, does not have an HTTP or HTTPS endpoint.
currently in preview, which offers further Visual Studio 2010 itself comes with templates
services. Access Control provides federated for five types of Azure applications:
authorisation, which means you can ASP.NET Web Role is an ASP.NET Web Forms
authenticate users against Active Directory application; ASP.NET MVC 2 Web Role is an
Federation Services version 2 (code-named ASP.NET MVC application; WCF Service Web
Role is an application that
publishes WCF services;
Worker Role is a generic
background service; CGI
Web Role is for FastCGI
applications (often built
with PHP).
Visual Studio 2010
also comes with a local
Azure Development Fabric
and Storage which means
you can test your Azure
Creating a new hosted service in the Azure developer portal. applications using the same

16// www.greymatter.com/visualstudio VISUAL STUDIO 2010 | feb 2010


VISUAL STUDIO 2010
Tools to set your ideas free

Getting started with Azure


An Azure Web application can be built and deployed with Visual Studio in just a few
steps. Here is how you can create a simple ASP.NET application running on Azure, using
Visual Studio 2010 Beta 2.
Before you begin, there are a couple of prerequisites. First, you have to set up an
Azure account. MSDN subscribers get a certain number of free minutes, depending on
subscription level. This gives you access to the Azure developer portal, where you can add
and manage services.
Next, run Visual Studio 2010 with the Azure Tools installed. Start a new project and
select Windows Azure Cloud Service for your preferred language. The wizard will ask you
to select one or more roles for the project. This example uses an ASP.NET Web Role.
The solution opens and you can create an ASP.NET application in the usual way.
Debugging is a little different though, since it runs on the Azure Development Fabric,
a local emulation of the Azure platform, and if needed on the Development Storage as
well.
When the application is ready to be deployed, right-click the solution and select
Publish. This opens Windows Explorer with two package files, one for the application and
one for configuration. This may change in later releases of the tools.
Leaving Explorer open, go back to the Developer Portal. Start a new hosted service
and enter a name, description and URL when prompted. Azure lets you choose a region
where you want the application stored, either for performance or legal reasons. Then click
Deploy in the portal. Browse to the location of your package and configuration files, and
click Deploy again. Azure will upload and install your application. Finally, click Run. After
a pause, the application starts and you can test it in your browser.

simple click-and-run that developers are integration. Active Directory Federation


familiar with. Services 2 is a key part of this, since it
SQL Azure is a full version of SQL Server brings together existing Active Directory
in the cloud, with a few differences and infrastructure with the new world of Azure
limitations. SQL Azure always uses SQL Server deployment. Interoperability is another theme,
authentication, and always connects on port and the use of standard HTTP, SOAP and REST
1433 with encryption. Since it is a shared protocols plus support for PHP applications
service, a connection may be closed if Azure means that Azure applications can easily
detects excessive resource usage, queries interoperate with others.
that run too long, or long-running single At the time of writing, MSDN Premium
transactions. subscriptions include 750 hours of a ‘small
The vision behind Windows Azure is compute’ instance with 10Gb of storage and
a broad one, and in line with Microsoft’s three SQL Azure databases. For full details of
strategy of providing both cloud and this and other promotional offers, see
on-premise platforms with excellent www.microsoft.com/windowsazure.

Feb 2010 | TOOLS TO SET YOUR IDEAS FREE www.greymatter.com/visualstudio //17


VISUAL STUDIO 2010
Tools to set your ideas free

Office development
Building applications for Microsoft Office and SharePoint
using Visual Studio 2010.

• Two things have shaped the Microsoft


Office development platform in recent years.
Workflow projects which come in both 2010
and 2007 flavours. You may also want to
One is the growing popularity of SharePoint, install SharePoint Designer, a free tool aimed
the document and collaboration server, which mainly at visual design.
fits well with the demand for Internet-based SharePoint 2010 is built on ASP.NET,
content management and workflow solutions. although for the current beta it is version 3.5
The other is the evolution of Visual Studio rather than 4.0. A SharePoint Application Page
Tools for Office (VSTO), which lets you extend is a custom ASP.NET page, and a Web Part is
Office with .NET code. Both have changed a container for an ASP.NET User Control. This
substantially with the advent of Office 2010, means that developers get the features of
SharePoint 2010 and Visual Studio 2010. ASP.NET combined with the rich SharePoint
document and collaboration APIs.
SharePoint development Visual Studio 2010 offers several
The big news for SharePoint developers is SharePoint project types. Web Parts let you
that developing and debugging SharePoint modify the appearance and behaviour of
applications is much less painful than before. SharePoint pages, or give end users tools to do
SharePoint is now a first-class project type so. Sequential or State Machine workflows let
within Visual Studio, and you can build a you design a workflow, with activities, states
project, set a breakpoint and debug your code and events, which is applied to items in one or
immediately. SharePoint servers are also now more SharePoint lists. A common example is a
available in the Server Explorer, letting you document approval process.
drill down through all the available elements The Business Data Connectivity Model
and inspect their properties. project is new. This is a standardised technique
That said, there is still some effort for integrating SharePoint with external data
involved in setting up a SharePoint 2010 such as contacts, knowledgebase items, sales
development machine. You need a 64-bit records in a relational database, or other
operating system (Windows Server 2008 in data accessed through Web services. Business
the beta, but the final build will also work Connectivity Services surfaces this data in
on Windows 7) and you need to install SharePoint lists and Web parts, or directly in
SharePoint 2010 on the development box, Office applications.
where it will take over port 80. The new An Event Receiver project lets you write
tools target SharePoint 2010 only, with the code triggered by SharePoint events, such as
exception of Sequential and State Machine when a document is added or changed. The

18// www.greymatter.com/visualstudio VISUAL STUDIO 2010 | feb 2010


VISUAL STUDIO 2010
Tools to set your ideas free

wizard hooks you up to the events and gives were complex to deploy with dependency on
you event handlers for adding custom code. the VSTO runtime, the Office Primary Interop
Visual Studio automatically deploys your Assemblies, and to specific versions of Office.
projects to the local development site for These issues have not completely gone
testing. When you are ready to deploy for away, but Office Development with Visual
real, you can use the Package option on the Studio 2010 and .NET 4.0 is less hassle than
Build menu to create a SharePoint package before. The dynamic features in C# 4.0 and
file. You can then deploy this to another support for optional and named parameters
SharePoint server using administration are a great fit with the Office COM API.
tools. Overall, it is now much easier for You can now embed interop types into your
developers to take advantage of SharePoint VSTO assemblies, giving it better resilience to
for customising intranet and Internet sites, or changes in Office or future versions of VSTO.
building applications that exploit SharePoint’s Furthermore you can target Office 2007 or
extensive built-in features. Office 2010 using Visual Studio 2010 and
.NET 4.0, provided that you install the new
Developing with Office VSTO runtime and keep to features that are
It was back in Office 2003 days that Visual common to both.
Studio Tools for Office (VSTO) brought the A key new feature in Visual Studio is
power and performance of .NET programming a visual designer for the Office Ribbon.
to Microsoft’s familiar productivity suite. Although some users still hanker after the old
Coding in .NET rather than the old Visual Basic menus, the ribbon is great for developers since
for Applications (VBA) makes it much easier it offers a richer surface for user interface
to integrate with other applications and data controls, including buttons, checkboxes,

The visual Ribbon Designer is new to Visual Studio 2010.

sources, and means all the features of Visual dropdown lists, image galleries and edit boxes.
Studio are available. You can also modify what is on the ribbon
That said, there were a few snags with in response to events, making it context-
VSTO, especially for C# developers. Lack sensitive or updated from external data.
of support for optional parameters meant There is also a 64-bit version of VSTO so
peppering the code with ‘ref missing’ or its that you can take advantage of 64-bit
equivalent. Another issue was that solutions Windows and Office.

Feb 2010 | TOOLS TO SET YOUR IDEAS FREE www.greymatter.com/visualstudio //19


VISUAL STUDIO 2010
Tools to set your ideas free

Parallel programming
New features in Visual Studio 2010 and Visual C++ 2010
make parallel programming easier.

•code Writing and debugging multi-threaded


is challenging, but necessary if you
The Concurrency Runtime
The Concurrency Runtime is a framework
are to take advantage of today’s multi-core for parallel programming in C++, and uses
computers. Supporting concurrency is a many of the new C++ 0x features internally.
strong theme in Visual Studio 2010, both for It has four components. The Parallel Patterns
managed (see Inside .NET 4.0 on page 8) and Library (PPL) lets you create concurrent
for native code. applications by dividing work into tasks
A core concept in this context is the that can execute in parallel. It also offers
task, a unit of work represented in C++ by a general-purpose parallel algorithms, including
lightweight class called task_handle, and in parallel_for and parallel_invoke. The PPL uses
.NET by System.Threading.Task. A task is not the services of the Task Scheduler (see below).
a thread as the duty of assigning tasks to The Asynchronous Agents Library contains
threads is taken care of by the framework. templates that enable multiple operations
A task group is what its name implies: a to handle synchronisation by exchanging
collection of tasks. The Parallel Patterns messages. The Task Scheduler schedules tasks
Library enables C++ programmers to take across available resources, and is configurable
advantage of tasks, either implicitly or through scheduler policies. The Resource
explicitly, as part of the new C++ concurrency Manager abstracts computer resources to
runtime which schedules and manages them. support the Task Scheduler, or your own
The .NET equivalent is the Task Parallel Library. concurrency library.
Tasks and Stacks
The concurrent
features in Visual
Studio 2010 are
supported by two
new debugging
windows which work
with both managed
and native code. The
Parallel Tasks window
lists the active tasks
in your application,
The Parallel Stacks window in Threads view, showing the Birds Eye navigator. showing their status,

20// www.greymatter.com/visualstudio VISUAL STUDIO 2010 | feb 2010


VISUAL STUDIO 2010
Tools to set your ideas free

Visual C++ 2010


There are several themes in Visual C++ 2010. At the compiler and library level, there is the
inclusion of a number of features from the emerging C++Ox standard, which is a major
revision of the language. C++0x is not yet final (0x is meant to be a year number and the
insider joke is to think of it as hexadecimal) but is nearing completion. Its aim is to make
C++ easier to learn as well as improving its capability. According to Bjarne Stroustrup,
creator of C++, “The range of abstractions that C++ can express elegantly, flexibly, and at
zero costs compared to hand-crafted specialised code has greatly increased.” Visual C++
2010 is not a full implementation of C++ 0x but does include:
• lambda expressions,
• static (compile-time) assertions,
• the auto keyword for type inference and decltype which gets the type of an expression,
• nullptr to denote the null pointer (though Microsoft recommends using the Microsoft-
specific __nullptr in native code and nullptr in managed code),
• rvalue references, which can make move assignments more efficient,
• long long for a 64-bit integer.
There are also parts of the C++ 0x standard library in Visual C++ 2010, including
forward_list, which is a single-linked list, and tuple. On the tools side, Visual C++ projects
now use MSBuild, as used by the other Visual Studio languages.

such as Running, Waiting or Scheduled, their concurrent application is executing and are
location and their thread assignment. Double- easier to use than the generic Threads debug
clicking a task takes you to its code. window. Of course these new views only make
The Parallel Stacks window presents a sense if you are using the new parallel library
number of graphical views of the call stack. in .NET or C++.
The Tasks view shows the call stack from a
task perspective, with threads that are not Parallel profiling
running tasks hidden. The current code path The Visual Studio profiler has new features
is shown by blue arrows and highlights, with for profiling parallel applications. A wizard
a yellow arrow on the currently active task. guides you to select the concurrency profiling
Tooltips show the code and line number of method with an option to visualize the
each method. behaviour of a multi-threaded application.
The Threads view expands the call stack to Running the analysis generates a report
show all the threads in the call stack, typically with three views: CPU utilisation, Threads
a much larger and more complex picture. and Cores. You can see to what extent the
Again, the current code path is shown in application used multiple cores, how many
blue. The underlying WPF graphics are used to threads executed, and what each thread was
advantage, with a sliding zoom control and an doing during the course of the application.
optional thumbnail view for navigating. When you need to fine-tune a concurrent
The Parallel Tasks and Parallel Stacks application, these new reports offer a lot
windows give excellent insight into how your of value.

Feb 2010 | TOOLS TO SET YOUR IDEAS FREE www.greymatter.com/visualstudio //21


VISUAL STUDIO 2010
Tools to set your ideas free

What’s new in languages


Visual Studio 2010 brings new versions of C# and Visual Basic to the
.NET platform, together with a brand new language.

•its new
It was in 2000 that Microsoft announced
.NET platform and with it a new
method, they are caught at runtime. The
purpose of dynamic types in C# is more to
language. Since then C# has succeeded do with interoperability with COM and with
beyond most expectations, and is now other dynamic languages than to make the
amongst the most sought-after skills in language a rival to Python or Ruby.
the industry, overtaking Visual Basic in the COM Interop is also improved by a new
professional market and vying with Java feature called Type Equivalence. This lets you
in overall popularity. One reason for C#’s embed type information for a COM library
success is that Microsoft evolved it relatively into your application. The first advantage is
rapidly, responding to developer feedback that your application can be deployed without
and changing trends. New features in C# 2.0 the often large Primary Interop Assemblies for
included generics, nullable types, anonymous applications like Microsoft Office, especially
methods and partial classes; while C# 3.0 since the embedded types only include the
added implicit typing, extension methods, ones you actually use. Second, the types are
lambda expressions and query expressions. loosely coupled, so they will work with any
Many of these language changes go compatible version of Office, for example,
hand in hand with changes in the underlying instead of just the one for which they were
Common Language Runtime (CLR). As a result, compiled. The overall outcome is that COM
Visual Basic has been able to keep pace, and Interop is easier, less verbose and more
the CLR has been able to better deliver on its efficient than in previous versions.
promise of supporting a variety of languages. Another new feature, Covariance and
In .NET Framework 4.0 and Visual Studio Contravariance, allows the implicit conversion
2010, that capability is demonstrated by the of variant interfaces that would previously
provision of a new language, Visual F#, along have failed.
with the Dynamic Language Runtime (DLR).
Visual Basic 2010
C# 4.0 Changes to Visual Basic 2010 are aimed at
The biggest advance in C# 4.0 is support ease of use as well as new capabilities. One
for dynamic types. This is actually a new that developers will welcome is implicit line
type, called dynamic, which is assumed to continuation. Until now, VB developers have
support any operation. If there are errors, had to use the underscore character to split
such as calling a non-existent property or a statement over multiple lines, which is ugly

22// www.greymatter.com/visualstudio VISUAL STUDIO 2010 | feb 2010


VISUAL STUDIO 2010
Tools to set your ideas free

and inconvenient. VB 2010 is smarter, and functions and expressions and aims to be
recognises circumstances where the next line safe, predictable and succinct. F# is based
continues a statement. One example is where on the ML language, extended for object
the statement is within braces that have yet orientation as in Objective Caml, and comes
to be closed, such as: out of Microsoft Research in Cambridge. It is a
pragmatic rather than a pure implementation
Dim result as Integer of functional programming, and has full
result = (1 + 2 + access to the .NET Framework.
3)
F# has several strong points. One is for

Other examples include


statements after assignment
operators, or within
embedded XML literals,
after the dot in member
qualifiers, and before and
after query operators.
The intent is that most
of the time you can code
naturally without needing
the line continuation
character, though there are
circumstances when it is still
needed.
Another time-saving A DirectX visualisation created by an F# script.

feature is auto-implemented
properties. Instead of having to write get and mathematical expressions, and for code
set methods, VB will do this for you. Type: that makes heavy use of maths such as
graphics manipulation. It is also ideal for
Property MyProp As String = “My property” concurrent programming, and has built-in
support for asynchronous workflows. Parallel
You can then reference not only MyProp but programming with F# is safer than with most
a hidden variable, _MyProp, which backs the programming languages. F# performs well,
property. since it benefits from the high performance of
In addition, VB 2010 has improved the underlying CLR.
dynamic support, type equivalence and Visual Studio 2010 comes with several F#
covariance similar to that in C# 4.0. project types including Library, Application,
Silverlight Library and a tutorial. There is also
Visual F# an interactive F# console which you can open
F# is a new language which brings functional from the toolbar or with Ctrl-Alt-F, where
programming into the .NET mainstream. A you can try out F# expressions. For more
functional programming language emphasises information see http://fsharp.net.

Feb 2010 | TOOLS TO SET YOUR IDEAS FREE www.greymatter.com/visualstudio //23


VISUAL STUDIO 2010
Tools to set your ideas free

Lifecycle Management
Visual Studio 2010 makes it easier to manage the application
lifecycle from design through to deployment.

•release
Visual Studio 2010 is the third major
of Microsoft’s suite of application
build services and can be used on a client
or a server; or Standard Single Server which
lifecycle tools, Team System. At its heart is includes SharePoint for project portals and
Team Foundation Server (TFS), a repository requires a server operating system.
for source code and ‘work items’ such as The appearance of TFS Basic is significant.
bug reports, feature requests or performance This can even run on the same machine
issues, which is integrated with the Visual as Visual Studio, so small teams and lone
Studio IDE. A project portal built on developers can use features such as source
SharePoint supports the team, letting you code management without needing a third-
review project status, get reports and interact party add-on. The wizard also has options for
with team members. more complex setups using multiple servers or
There is a build system for automating, custom choices. You still need to pre-install
managing and verifying builds, while process SQL Server and SharePoint if you want
templates offer guidance and documentation something other than the free editions, which
for specific development methodologies, the is necessary to get the full range of features.
default being Microsoft Solutions Framework
for Agile Software Development. In addition, What’s new
there is a comprehensive set of Visual Studio Team System 2010 is a major release. Along
tools for modelling and diagramming, with simplified deployment, there is Lab
test-driven development, load testing and Management (see right), a new Web access
performance testing. Some of these can be feature, IntelliTrace debugging that lets you
used without installing the full suite: unit step backwards through code, and numerous
testing, for example, comes with all paid-for other changes and updates.
editions of Visual Studio. Team System Web Access is a product
Microsoft has worked hard to simplify developed by devBiz as TeamPlain Web Access.
TFS installation, which is inherently complex It has been available as a free Team System
because of dependencies on other products add-on for some time, but is now bundled
including SharePoint, SQL Server, IIS and into Team System 2010 itself. Whereas
System Center. With TFS 2010, a wizard will the Project Portal focuses on non-code
do most things for you if you are happy to elements, such as documentation, reporting
accept one of two default configurations. and analysis, the Web access site is purely
You can choose between Basic, which installs for developers. You can access code with
only source control, work item tracking and changesets and version history, work items

24// www.greymatter.com/VS2010 VISUAL STUDIO 2010 | feb 2010


VISUAL STUDIO 2010
Tools to set your ideas free

Lab Management
Lab Management automates what developers frequently do anyway: testing on virtual
machines (VMs). In order to set this up, you need one or more servers running Hyper-V,
Microsoft’s virtual machine host, together with System Center Virtual Machine Manager
(SCVMM) to manage your VMs.

How Lab Management integrates with the rest of Team System.

The next step is to integrate Team System’s test controller and build controller with
the virtual lab. This enables workflow integration, where you can automatically reset the
virtual lab to a clean state, install your application and run execution tests.
Microsoft Test and Lab Manager is where you import virtual machine templates
and create environments formed of one or more VMs. You can then deploy and start an
environment, ready for use. At any time you can snapshot the environment.
The Testing Center lets you define and run tests against a virtual environment and
collect the resulting logs. A great feature is the ability to link bug reports to environment
snapshots. You or other team members can open the bug report, click Connect to
Snapshot, and observe the bug in a live running system.
You can also link builds to test plans. When creating a definition for an automated
build, a process wizard lets you select a Lab environment, scripts to run on deployment,
and a suite of tests to run.
Another interesting feature is environment cloning which allows several people to
work simultaneously on different copies of the same environment snapshot. One scenario
is that developers can work on fixing a bug while testers concentrate on further tests.
Although some effort is involved in setting up Lab Management, it is a huge feature
and worlds away from the days of continually reinstalling Windows in order to test a
setup problem or replicate different application combinations.

Feb 2010 | TOOLS TO SET YOUR IDEAS FREE www.greymatter.com/VS2010 //25


VISUAL STUDIO 2010
Tools to set your ideas free

such as bugs and tasks, and reports on builds. The technology code-named ‘Oslo’, which
It is a slick, fast Web application, and useful includes the M modelling language, a model
both internally and externally. repository, and a tool for visualising relational
IntelliTrace is a new approach to source data, is not included directly in Visual Studio
code debugging that relies on a trace log 2010. Oslo is now called SQL Server Modeling,
created as the application runs. The advantage which is currently in preview. That said, SQL
is that you can back-track through application Server Modeling does integrate with Visual
state to examine conditions before the bug Studio and includes projects based on M.
occurred, rather than just afterwards. This is In Visual Studio 2010 you can create
often more illuminating and can be a great Modeling Projects that contain diagrams. UML
time-saver. You can use IntelliTrace directly support is a big theme and diagrams based on
within the Visual Studio IDE, when debugging UML 2.1.2 include Activity, Component, Class,
locally, or examine logs created either by Sequence and Use Case. A new diagram type
IntelliTrace or by the Test and Lab Manager. called a Layer Diagram lets you describe the
By default IntelliTrace does not log call logical architecture of an application, with
information which minimises performance each layer representing a logical group.
impact but makes it less useful. Activate full Diagrams are also used to better
IntelliTrace logs by enabling IntelliTrace events understand existing code. You can generate a
and call information in Visual Studio options. dependency graph showing the relationships
When you hit a breakpoint, you can step back and organisation of a project, or drag code
as well as forward through code, and examine elements from the new Architecture Explorer
the previous values of variables. Another onto an existing graph diagram.
benefit is the IntelliTrace Events view, which
gives a user-friendly view of application Build management
events such as button clicks. One of the strengths of Team System is a build
management system with hooks into other
Modelling parts of the suite. Configuration involves a
Visual Studio has taken a variety of build controller to manage builds, and one or
approaches to modelling and architecture more build agents to carry them out. This can
over the years, some of which failed to all be on one machine running Visual Studio
achieve wide adoption and were dropped in in small setups, or on separate servers. The
subsequent versions. Unlike some previous build system can be linked to check-in, so you
efforts, Visual Studio 2010 does not attempt can do continuous integration with a build on
to re-invent modelling but rather to provide every code check-in.
strong modelling tools based on the UML New in this edition is Gated Check-in,
standard, as well as integrating a model- where code is only fully checked-in if it builds
driven approach into tools throughout the successfully. You can also define a process
IDE. Workflow projects, for example, are a including automated tests, code analysis and
natural fit with model-driven development workspace cleaning. If Lab Management is
and Visual Studio provides the necessary tools. enabled, the build process integrates with
The diagramming tools benefit from the new lab environments for automated virtual
WPF-based IDE. deployment and testing.

26// www.greymatter.com/VS2010 VISUAL STUDIO 2010 | feb 2010


VISUAL STUDIO 2010
Tools to set your ideas free

Vendor Showcase
Some of the many third party tools and controls
that are available for Visual Studio 2010.

• A major benefit of Microsoft’s platform which communicates with a Web service


is the high level of third-party support from (for which developers should ensure user
components, libraries and add-ons. Several consent or risk being accused of supplying
companies have comprehensive suites of spyware). You can then track how much your
interface controls, which means developers application is being used, what features are
can quickly assemble a modern and feature- being exercised, and what operating system
rich user interface. Although there is a it is running on. Statistics can be sent to a
large degree of overlap between the major free portal, or to your own site. Enhanced
component suites on offer, that does not features and SSL encryption are available if
mean they are all similar. Each DataGrid you purchase the full suite.
has its own strengths and weaknesses, for Dotfuscator has further software
example, and usually a free trial is available. protection features. Shelf Life lets you set an
Another factor is that some vendors are expiry date, to support trial and subscription
quicker than others to offer full Visual Studio software business models. Tamper detection
2010 support and components for newer detects whether the application binary
frameworks such as Silverlight and ASP.NET has been altered. Both are hooked into the
MVC. Furthermore, third-party support is not messaging system, so that you can receive
only about components: there are also some alerts when an application is misused. The
excellent add-on tools which can quickly free community edition has a generous range
repay their cost in increased productivity. of features; but the commercial versions add
more customisation options.
Dotfuscator
PreEmptive Solutions Dotfuscator is bundled ComponentOne
as a free community edition in Visual Studio ComponentOne offers control suites for
2010, with commercial versions available Windows Forms, WPF, ASP.NET and Silverlight.
for purchase. This is a well-known tool for ComponentOne also supports mobile devices
obscuring .NET assemblies, making them – an increasingly important developer focus.
harder to decompile and so protecting Studio for iPhone lets you create ASP.NET Web
intellectual property. sites tailored for the iPhone and with the look
The new Dotfuscator has significant new and feel of Apple’s user interface. Controls
features. One is Runtime Intelligence Support, include Calendar, CoverFlow, dialogs and data
which is like Web analytics for the desktop. display. Studio for Mobile supports the .NET
Dotfuscator injects code into your application Compact Framework for mobile devices, and

28// www.greymatter.com/visualstudio VISUAL STUDIO 2010 | feb 2010


VISUAL STUDIO 2010
Tools to set your ideas free

includes a FlexGrid control as well as Chart, which displays UI elements using a book and
MaskedTextBox and Zip. page model. The Silverlight edition also has
ComponentOne Studio for WinForms has a DataGrid, and an innovative Cube control
over 60 controls. Alongside well-featured that lets you display information as faces on a
charts, grids, and input controls, there is an rotatable cube.
Excel component that reads and writes Excel Finally, ComponentOne still offers an
files, including support for the newer Open ActiveX suite including its classic controls
XML format in Office 2007. A PDF component such as VSFlexGrid, giving you the speed of
lets you create Adobe PDF documents, native code for Visual C++ and other ActiveX
and a Flash control allows integration of containers.
Flash multimedia content in your desktop
application. DevExpress
The suites for WPF and Silverlight have Component and tools vendor DevExpress
several controls in common, such as Accordion says on its Web site that Visual Studio 2010
which is a list of expandable items, and Book promises to “fundamentally change how and

Intel Parallel Studio


Parallel Studio is a suite of four products supporting concurrent programming, mainly
focused on native code. Parallel Composer includes compilers, libraries and debugging
extensions, enabling you to use OpenMP as well as Intel’s Threading Building Blocks
and Integrated Performance Primitives (libraries that simplify parallel coding and take
advantage of the number of processor cores available at runtime). Parallel Inspector
tackles the hard problem of multi-threaded debugging. Parallel Amplifier is a profiler for
optimising multi-threaded applications. Parallel Advisor, currently a technology preview, is
a design assistant that evaluates your proposed candidates for parallelism.
But is the Intel suite still necessary? At a library level, Intel’s Director of Software
Products James Reinders agrees that “[Microsoft’s] Parallel Patterns Library and [Intel’s]
Threading Building Blocks are extraordinary similar in their
approaches,” but adds that, “Threading Building Blocks has
more functionality, solves more problems for C++, and is
portable across a lot of platforms.”
More widely, Reinders claims Intel is ahead in several
areas: “In my opinion there’s two critical things that
Microsoft is missing. Once you’ve implemented something
you’re going to quickly find that you have to root out the
non-determinism: you have to get rid of data races and
deadlocks. Microsoft has no solution for that. You also want
your program to scale. We’ve put things into Parallel Studio
that solve that. If you’re serious about getting things done,
Intel’s Director of Software
Parallel Studio will easily prove itself.” Products, James Reinders.

Feb 2010 | TOOLS TO SET YOUR IDEAS FREE www.greymatter.com/visualstudio //29


VISUAL STUDIO 2010
Tools to set your ideas free

what we’ve been developing,” and is aiming with is a library for application design, and
to support it at an early stage. It is also now eXpress Persistent Objects which is for object-
releasing its first controls for ASP.NET MVC, relational mapping.
including a data grid, navigation and tab
controls, which will be in beta from April. Infragistics
The DevExpress XtraGrid for Windows Infragistics offers the NetAdvantage suite with
Forms is one of the most sophisticated grid versions for ASP.NET, Windows Forms, WPF
controls available, at the price of some and Silverlight. The company supported Visual
complexity. It has strong sorting and grouping Studio 2010 even in beta form and is aiming
features, including controls which allow the for early availability for Microsoft’s new IDE.
user to filter, sort and group data at runtime. Windows Azure is a supported platform for
Other Windows Forms controls include a the NetAdvantage Web Client controls.
rich text editor, a Wizard, a spell checker, The main Infragistics suites are
and components for OLAP (Online Analytic comprehensive in scope. NetAdvantage
Processing) data mining. for Windows Forms supports Microsoft’s
The company also supports WPF and Composite UI Application Block design
Silverlight. The WPF suite has a printing and pattern, and has over 70 controls including
exporting library, including support for PDF grids and charts, dock management, PDF
and Excel, as well as the usual grids and chart export, enhanced printing, toolbars and
controls. The Silverlight controls include a ribbons. The ASP.NET package includes
Rich Text Editor, a transition animator, and an HTML editor, DataGrid and DataTree,
controls for menus and toolbars. There is also scheduling controls, and export to Adobe PDF
a grid control with grouping and sorting, as or Microsoft Excel. The range of WPF controls
you would expect from DevExpress. is more limited, but does take advantage of
DevExpress has a strong range of the graphical effects available with a variety
ASP.NET Web Form controls. Along with grids, of carousel controls as well as a DataGrid,
charts and reporting tools, there are business DataPresenter, Ribbon and OutlookBar.
intelligence components including OLAP data For Silverlight, Infragistics has a rapidly
mining, an HTML editor and spell checker, an evolving suite with grid, chart and edit
upload control and a component that lets you controls as well as an HTML viewer that uses
present links in the popular tag cloud format. the host browser to render HTML content
CodeRush is an add-in for C# and within Silverlight. The separate NetAdvantage
Visual Basic that adds smart code selection, for Silverlight Data Visualization, now in
intelligent declaration and code refactoring. preview, turns Microsoft’s plug-in into a
There is an Xpress version for free download platform for business intelligence. It includes
and a Pro edition with customisable code a pivot grid for analysing multi-dimensional
templates that can generate code for you. data, as well as other controls including chart,
Refactor! Pro has many more refactorings, gauge, timeline and bullet graph.
with preview hinting to show how the Infragistics Quince takes the patterns
code will change if a refactoring is applied. and practices concept and applies it to user
Business Application Frameworks is composed interface design. In part a community project,
of two products, eXpressApp Framework there is a free UX (User Experience) Patterns

30// www.greymatter.com/visualstudio VISUAL STUDIO 2010 | feb 2010


VISUAL STUDIO 2010
Tools to set your ideas free

catalogue with best-practice designs and The company now offers over 40 controls
ideas, and the commercial Quince Pro that for Silverlight, sharing code where possible
adds further tools and private design libraries. with WPF versions and thereby gaining good
Infragistics also offers TestAdvantage, compatibility.
an add-on product for either HP QuickTest Along with the usual grids, charts and
Professional or IBM Rational Functional Tester. progress bars, Telerik has some distinctive
TestAdvantage lets you script a UI built with controls such as the RadBook, which includes
NetAdvantage Windows Forms controls to smooth flip animations to give users the
identify quality issues. feel of turning the pages of a book. The
RadRibbonBar implements a ribbon control
Dundas similar to that in Microsoft Office 2007,
Dundas is a data visualisation specialist with and is available for Windows Forms, WPF
three core components, all available in .NET and Silverlight. RadCoverFlow for Silverlight
editions for both ASP.NET and Windows and WPF offers rich navigation through
Forms. Silverlight integration is also available. media collections, with 3D transitions and
The ASP.NET controls support Ajax for smooth configurable camera and reflection.
page refresh. On the HTML side, Telerik has over 35
The features of Dundas Chart include
animation, an innovative scorecard chart
type, OLAP support for visualising three-
dimensional data, and a chart builder
tool which can be used by designers and
non-technical users.
Dundas Gauge is focused on showing data
using familiar gauge indicators, including
real-time displays. The gauge concept fits with
the Dundas theme of helping developers to
construct digital dashboards for monitoring
status and progress, and numerous gauge
types are on offer.
Telerik’s RadBook component gives the look and feel of a
The display and analysis of geographical book with turning pages.
data is catered for by Dundas Map. A Map
Wizard lets developers choose a base map controls for ASP.NET Ajax, including an HTML
and customise it with scales, legends, and editor which is apparently used by Microsoft
interactive controls for panning and zooming. on the MSDN site. These combine server-
A large collection of maps is included. side and client-side code, using Microsoft’s
AJAX engine along with the open source
Telerik jQuery, which is also supported by Microsoft.
Although it also supports Windows Forms The RadGrid will bind to the new WCF RIA
and classic ASP.NET, Telerik has moved rapidly Services. Its Grid, PanelBar, TabStrip and Menu
to build for Microsoft’s newest frameworks, controls are specifically extended for
namely WPF, Silverlight and ASP.NET MVC. ASP.NET MVC.

Feb 2010 | TOOLS TO SET YOUR IDEAS FREE www.greymatter.com/visualstudio //31


VISUAL STUDIO 2010
Tools to set your ideas free

Team System in practice


Three companies discuss their experiences with Visual Studio 2010.

• Microsoft has packed a lot into Visual he says. “I’m very excited about the testing
Studio 2010, but what do users make of it all? tools in particular. IntelliTrace is a highlight,
Peter Ibbotson of Reveal Media has a now you can step both forward and backward
developer’s perspective. “We’ve been using through the code. Historically with debug
Visual Studio 2010 to develop new versions of you step forward. Now you can actually move
our multimedia programs under WPF. We’ve backwards through the code, effectively
more or less finished a version that uses WPF reversing operations, and see what changed.
as a Kiosk application for the police, targeting It’s reducing a lot of time in debugging .”
CLR 4.0, and are using it at the moment Then there is the new virtual Lab
to build a simplified WPF version of our Management in Team System: “This is a huge
CARMA [Camera Archive and Management] addition for the product suite as a whole that
application for standalone environments. For will make it easier to do good testing and
the most part it’s been the ability to style promote good practices. I’ve spent a lot of
elements and create video overlays ‘cheaply’ time working with it. It’s a bit daunting to put
that makes us like WPF. The new ‘dynamic’ into place with a lot of moving parts - there’s
keyword in C# 4 has made a lot of our code tools outside of the Visual Studio stack that
cleaner, too. you have to put in place - but there’ll be a big
“The option was to move to Visual Studio return on investment.”
2008, or to skip a generation and go to On the language side Ruminer is impressed
2010 for our WPF generation of products. with F#: “It is something that I’ll use. It’s a
While risky, skipping the 2008 generation of good dynamic language, it will be great for
products hasn’t been a huge problem for us.” Domain Specific
Ibbotson says that using the preview was Languages,
“not a bad experience” despite occasional and it’s also
crashes and high resource requirements. extremely good
“It burns memory and is slow on lower for parallelism. I
specification machines,” he says, “but I’m might have a C#
hopeful the next interim version fixes most application and
of this.” I might have a
library that needs
Stepping backwards to do threaded or
Michael Ruminer is a Senior Solutions domain-specific
Architect for EMC Consulting. “I’ve focused operations in F#. Michael Ruminer is a Senior
Solutions Architect for EMC
a lot of my time on the development tools,” I’m surprised that Consulting.

32// www.greymatter.com/visualstudio VISUAL STUDIO 2010 | feb 2010


VISUAL STUDIO 2010
Tools to set your ideas free

it got rolled into the


product as quickly as it
did but I’m glad to see it
there. I think it’s a great
language.”
While Ruminer
is happy with the
new WPF-based user
interface, he says it will
take some time to adjust:
“It’s just that I’ve got
to become comfortable
and used to it. I think
that will be the case for
many people. I liken it to
the ribbon bars in Office Talmia, an ALM add-on for Visual Studio 2010 produced by GamCom.
2007. You just have to
get comfortable with it.” way, for ad hoc task tracking, which makes
for inconsistent granularity and reporting.
Killer features Without proper control of work item use, it
“I’m very keen on Visual Studio 2010. We’re can be difficult for users to implement and
running it now and looking forward to enforce their ALM processes consistently.”
moving everything onto it,” says Chris Turvil, “Talmia is about modelling your ALM
Methods and Tools Manager for GamCom process as a workflow, and having Team
Solutions Ltd: “What I’m most excited System implement it so that the work items
about are the new testing facilities and the you need are created for you as you need
IntelliTrace debugger. These are both killer them. Talmia also provides process oriented
features.” reports, email alerts and other automation
Turvil sees Visual Studio from several features so you don’t need to worry about
angles. His company offers consultant advice reading process documents.”
for Team System users. “Like any complex So how was Visual Studio 2010 from
tool, it can be used well and it can be used the perspective of an add-on developer?
badly. In our experience a lot of people buy “Microsoft hasn’t changed things
Team System but are unsure what to do with unnecessarily. From our point of view it
it once they’ve got it installed. However, with was a pretty painless upgrade.”
a little guidance and best practice, it adds an
awful lot of value to development – and that
only gets better with the 2010 version.” Find out more...
i GamCom at www.gamcom.com
GamCom’s consultancy work led directly
Talmia at www.talmia.com
to an add-on product called Talmia. Turvil
Reveal Media at www.revealmedia.com
continues: “What we found is that people EMC Consulting at www.emc.com
tend to use work items in a very inconsistent

Feb 2010 | TOOLS TO SET YOUR IDEAS FREE www.greymatter.com/visualstudio //33


VISUAL STUDIO 2010
Tools to set your ideas free

Licensing & upgrading


What you need to know to make the most of what’s on offer.

• Visual Studio 2010 will be available for four technical support incidents each year.
purchase in just four different configurations, There will also be a set of Visual Studio
only one of which can be bought without an 2010 Express editions that can be downloaded
MSDN subscription. free of charge from the Microsoft Web site.
New to Visual Studio 2010 Professional
are the Unit Testing tools, which are now Auto-Upgrade
included with all retail editions. This is the If you are thinking of taking out an MSDN
only edition available without an MSDN subscription, then now is a good time.
subscription. Provided you have a subscription to MSDN
Visual Studio 2010 Professional with Premium that is active on 9 April, then you
MSDN is similar to the current MSDN will benefit from Microsoft’s Auto-Upgrade
Professional subscription, coming with offering which automatically upgrades free
versions of Windows Server, SQL Server and of charge Visual Studio 2008 Professional
various SDKs for development and test use to Visual Studio 2010 Premium, rather than
only. It also includes a full licence to Team to the Professional edition; and any Visual
Foundation Server (TFS) and comes with two Studio 2008 Team System edition to Visual
free technical support incidents each year. Studio 2010 Ultimate, rather than to the
Visual Studio 2010 Premium with Premium edition. Those licensing Visual Studio
MSDN adds a wider range of testing and 2008 Team Suite with an MSDN Premium
profiling tools, including those for database subscription will automatically be upgraded to
development. It also adds Microsoft Dynamics Visual Studio 2010 Ultimate with MSDN.
and a range of other servers for development Furthermore, if you have a Visual Studio
and test use, plus full licences to Expression Professional 2005 or 2008 licence then you
Studio 3, Office Professional Plus 2010, can save up to £400 on the price of attaching
Visio Premium 2010 and Project Professional an MSDN Premium subscription under a
2010 (similar to the current MSDN Premium Volume Licence, provided you do so before
subscription). You are allowed four free 31 March. You will then automatically
technical support incidents each year. benefit from the Auto-Upgrade offer.
Visual Studio 2010 Ultimate with MSDN
comes with the full set of application lifecycle
management tools including IntelliTrace, Lab Find out more...
Management and UML 2 support, together
i For full details of your licensing options
visit www.greymatter.com/visualstudio
with the full benefits of an MSDN Premium or call 01364 654 100.
subscription, including TFS and complete with

34// www.greymatter.com/visualstudio VISUAL STUDIO 2010 | feb 2010

You might also like