magazine
THE MICROSOFT JOURNAL FOR DEVELOPERS
OCTOBER 2015 VOL 30 NO 10
Microsoft Azure—the Big Picture
Tony Meleg .....................................................................12
ASP.NET 5 Anywhere with OmniSharp
and Yeoman
Shayne Boyer and Sayed Ibrahim Hashimi ...........................20
Bower: Modern Tools for Web Development
Adam Tuliper ..................................................................28
Build and Deploy Libraries with Integrated
Roslyn Code Analysis to NuGet
Alessandro Del Sole .........................................................40
A Split-and-Merge Expression Parser in C#
Vassili Kaplan .................................................................. 50
Develop a Windows 10 App
with the Microsoft Band SDK
Kevin Ashley ...................................................................56
COLUMNS
UPSTART
The Yoga of Rookie Success
Krishnan Rangachari, page 6
WINDOWS WITH C++
Coroutines in Visual C++ 2015
Kenny Kerr, page 8
TEST RUN
Linear Discriminate Analysis
Using C#
James McCaffrey, page 64
THE WORKING
PROGRAMMER
How To Be MEAN: Express Install
Ted Neward, page 68
DON’T GET ME STARTED
Anachronisms
David Platt, page 72
Understanding
Cloud Development............12
1015msdn_C1_v2.indd 1 9/14/15 8:42 AM
msdn magazine
2
ID STATEMENT MSDN Magazine (ISSN 1528-4859) is
published monthly by 1105 Media, Inc., 9201 Oakdale
Avenue, Ste. 101, Chatsworth, CA 91311. Periodicals
postage paid at Chatsworth, CA 91311-9998, and at
additional mailing ofces. Annual subscription rates
payable in US funds are: U.S. $35.00, International
$60.00. Annual digital subscription rates payable in
U.S. funds are: U.S. $25.00, International $25.00. Single
copies/back issues: U.S. $10, all others $12. Send orders
with payment to: MSDN Magazine, P.O. Box 3167, Carol
Stream, IL 60132, email MSDNmag@1105service.com
or call (847) 763-9560. POSTMASTER: Send address
changes to MSDN Magazine, P.O. Box 2166, Skokie,
IL 60076. Canada Publications Mail Agreement No:
40612608. Return Undeliverable Canadian Addresses
to Circulation Dept. or XPO Returns: P.O. Box 201,
Richmond Hill, ON L4B 4R5, Canada.
Printed in the U.S.A. Reproductions in whole or part
prohibited except by written permission. Mail requests
to “Permissions Editor,” c/o MSDN Magazine, 4 Venture,
Suite 150, Irvine, CA 92618.
LEGAL DISCLAIMER The information in this magazine
has not undergone any formal testing by 1105 Media,
Inc. and is distributed without any warranty expressed
or implied. Implementation or use of any information
contained herein is the reader’s sole responsibility. While
the information has been reviewed for accuracy, there
is no guarantee that the same or similar results may be
achieved in all environments. Technical inaccuracies may
result from printing errors and/or new developments
in the industry.
CORPORATE ADDRESS 1105 Media, 9201 Oakdale Ave.
Ste 101, Chatsworth, CA 91311 www.1105media.com
MEDIA KITS Direct your Media Kit requests to Chief
Revenue Ofcer Dan LaBianca, 972-687-6702 (phone),
972-687-6799 (fax), dlabianca@1105media.com
REPRINTS For single article reprints (in minimum
quantities of 250-500), e-prints, plaques and posters
contact: PARS International Phone: 212-221-9595.
E-mail: 1105reprints@parsintl.com.
www.magreprints.com/QuickQuote.asp
LIST RENTAL This publication’s subscriber list, as well as
other lists from 1105 Media, Inc., is available for rental.
For more information, please contact our list manager,
Jane Long, Merit Direct. Phone: 913-685-1301;
E-mail: jlong@meritdirect.com;
Web: www.meritdirect.com/1105
Reaching the Staff
Staff may be reached via e-mail, telephone, fax, or mail.
A list of editors and contact information is also available
online at Redmondmag.com.
E-mail: To e-mail any member of the staff, please use the
following form: FirstinitialLastname@1105media.com
Irvine Ofce (weekdays, 9:00 a.m. – 5:00 p.m. PT)
Telephone 949-265-1520; Fax 949-265-1528
4 Venture, Suite 150, Irvine, CA 92618
Corporate Ofce (weekdays, 8:30 a.m. – 5:30 p.m. PT)
Telephone 818-814-5200; Fax 818-734-1522
9201 Oakdale Avenue, Suite 101, Chatsworth, CA 91311
The opinions expressed within the articles and other
contentsherein do not necessarily express those of
the publisher.
President
Henry Allain
Chief Revenue Ofcer
Dan LaBianca
Chief Marketing Ofcer
Carmel McDonagh
ART STAFF
Creative Director Jeffrey Langkau
Associate Creative Director Scott Rovin
Senior Art Director Deirdre Hoffman
Art Director Michele Singh
Assistant Art Director Dragutin Cvijanovic
Graphic Designer Erin Horlacher
Senior Graphic Designer Alan Tao
Senior Web Designer Martin Peace
PRODUCTION STAFF
Director, Print Production David Seymour
Print Production Coordinator Anna Lyn Bayaua
ADVERTISING AND SALES
Chief Revenue Ofcer Dan LaBianca
Regional Sales Manager Christopher Kourtoglou
Account Executive Caroline Stover
Advertising Sales Associate Tanya Egenolf
ONLINE/DIGITAL MEDIA
Vice President, Digital Strategy Becky Nagel
Senior Site Producer, News Kurt Mackie
Senior Site Producer Gladys Rama
Site Producer Chris Paoli
Site Producer, News David Ramel
Director, Site Administration Shane Lee
Site Administrator Biswarup Bhattacharjee
Front-End Developer Anya Smolinski
Junior Front-End Developer Casey Rysavy
Executive Producer, New Media Michael Domingo
Ofce Manager & Site Assoc. James Bowling
LEAD SERVICES
Vice President, Lead Services Michele Imgrund
Senior Director, Audience Development
& Data Procurement Annette Levee
Director, Audience Development
& Lead Generation Marketing Irene Fincher
Director, Client Services & Webinar
Production Tracy Cook
Director, Lead Generation Marketing Eric Yoshizuru
Director, Custom Assets & Client Services
Mallory Bundy
Editorial Director, Custom Content Lee Pender
Senior Program Manager, Client Services
& Webinar Production Chris Flack
Project Manager, Lead Generation Marketing
Mahal Ramos
Coordinator, Lead Generation Marketing
Obum Ukabam
MARKETING
Chief Marketing Ofcer Carmel McDonagh
Vice President, Marketing Emily Jacobs
Senior Manager, Marketing Christopher Morales
Marketing Coordinator Alicia Chew
Marketing & Editorial Assistant Dana Friedman
ENTERPRISE COMPUTING GROUP EVENTS
Senior Director, Events Brent Sutton
Senior Director, Operations Sara Ross
Director, Event Marketing Merikay Marzoni
Events Sponsorship Sales Danna Vedder
Senior Manager, Events Danielle Potts
Coordinator, Event Marketing Michelle Cheng
Coordinator, Event Marketing Chantelle Wallace
Chief Executive Ofcer
Rajeev Kapur
Chief Operating Ofcer
Henry Allain
Senior Vice President & Chief Financial Ofcer
Richard Vitale
Executive Vice President
Michael J. Valenti
Vice President, Information Technology
& Application Development
Erik A. Lindgren
Chairman of the Board
Jeffrey S. Klein
General Manager Jeff Sandquist
Director Dan Fernandez
Editorial Director Mohammad Al-Sabt mmeditor@microsoft.com
Site Manager Kent Sharkey
Editorial Director, Enterprise Computing Group Scott Bekker
Editor in Chief Michael Desmond
Features Editor Lafe Low
Features Editor Sharon Terdeman
Group Managing Editor Wendy Hernandez
Senior Contributing Editor Dr. James McCaffrey
Contributing Editors Rachel Appel, Dino Esposito, Kenny Kerr, Julie Lerman, Ted Neward,
David S. Platt, Bruno Terkaly, Ricardo Villalobos
Vice President, Art and Brand Design Scott Shultz
Art Director Joshua Gould
OCTOBER 2015
VOLUME
30
NUMBER
10
magazine
1015msdn_Masthead_v1_2.indd 2 9/14/15 8:43 AM
msdn magazine
4
e discipline of computer security has more than a little in common
with airline flight safety. Both are fraught with high stakes and
increasing complexity over time. When something goes wrong,
remediation is oen built on painstaking forensics and paid for
with funds that become available only aer a high-prole failure.
Another common thread: Catastrophic failure oen springs from
mundane causes.
Take the infamous data breach at Target in 2013. Hackers entered
the network the old-fashioned way—they stole credentials from
an HVAC contractor with login rights to the Target network, and
from there gained access to payment systems. e installation of
malware was actually detected and agged by the FireEye security
software Target had deployed months earlier, yet when security
sta in Bangalore forwarded the alerts to Minneapolis, the security
team there declined to take action. Over the months that followed,
some 40 million debit and credit cards, along with gigabytes of
customer data, were exltrated from the Target systems, leading to
more than $100 million in losses for the retail giant.
A similar “chain of disaster” pattern is evident in many airliner
accidents. Air France 447 in 2009 crashed into the Atlantic Ocean
aer encountering thunderstorms at night near the equator while
enroute from Rio de Janeiro to Paris. It was later learned that ice
had likely blocked the aircra’s pitot tubes—small openings on the
side of the hull for measuring airspeed and pressure. is produced
incorrect and conicting data that disabled the plane’s autopilot and
apparently disoriented the rst ocer ying the cra through the
storm. Possibly convinced that his plane was ying dangerously fast,
he commanded a constant nose up attitude that, in fact, sharply
reduced airspeed and produced a high-altitude stall. e aircra
ultimately fell belly rst into the sea, killing all on board.
In both cases, systems that performed as designed in the face
of negative events were misinterpreted by the people managing
them. Both the security team at Target and the pilot on Air France
447 struggled to comprehend the data presented to them and took
actions that made a bad situation worse. Part of the blame rests with
the human operators, but part lies also with the systems themselves.
For the crew of Air France 447, confusing audible warnings
played a role. By design, the stall warning of the Airbus 340 goes
silent if measured airspeed falls below a threshold where the data
is considered invalid. So when the rst ocer lowered the nose of
the jet to gain much-needed airspeed, it actually caused the stall
warning to reengage, while pulling back to raise the nose (and
resume the deep stall) silenced the alarm. Faced with conicting
data inputs and confusing feedback from the stall horn, the pilots
very likely didn’t know what instruments to trust.
If there is one overriding parallel between air accident inves-
tigations and software security incidents, it’s that each presents
an invaluable opportunity to better understand the complex
interaction of human factors, environmental stresses, and system
behavior and automation.
Chain of Disaster
© 2015 Microsoft Corporation. All rights reserved.
Complying with all applicable copyright laws is the responsibility of the user. Without limiting the rights under copyright, you are not permitted to reproduce, store, or introduce into a retrieval system MSDN Magazine or any part of MSDN
Magazine. If you have purchased or have otherwise properly acquired a copy of MSDN Magazine in paper format, you are permitted to physically transfer this paper copy in unmodied form. Otherwise, you are not permitted to transmit
copies of MSDN Magazine (or any part of MSDN Magazine) in any form or by any means without the express written permission of Microsoft Corporation.
A listing of Microsoft Corporation trademarks can be found at microsoft.com/library/toolbar/3.0/trademarks/en-us.mspx. Other trademarks or trade names mentioned herein are the property of their respective owners.
MSDN Magazine is published by 1105 Media, Inc. 1105 Media, Inc. is an independent company not afliated with Microsoft Corporation. Microsoft Corporation is solely responsible for the editorial contents of this magazine. The
recommendations and technical guidelines in MSDN Magazine are based on specic environments and congurations. These recommendations or guidelines may not apply to dissimilar congurations. Microsoft Corporation does not make
any representation or warranty, express or implied, with respect to any code or other information herein and disclaims any liability whatsoever for any use of such code or other information. MSDN Magazine, MSDN and Microsoft logos are
used by 1105 Media, Inc. under license from owner.
Visit us at msdn.microsoft.com/magazine. Questions, comments or suggestions for MSDN Magazine? Send them to the editor: mmeditor@microsoft.com.
MICHAEL DESMOND
Editor’s NotE
In both cases, systems that
performed as designed in the
face of negative events were
misinterpreted by the people
managing them.
1015msdn_DesmondEdNote_v2_4.indd 4 9/14/15 8:49 AM
msdn magazine
6
As a young engineer, I struggled at rst to t into my team. Aer
all, my colleagues had been there for years. How could I ever com-
pare? e more I advanced, the more my teammates seemed to stay
ahead of me. Being intelligent wasn’t enough. Maybe I’d made a
terrible mistake in becoming an engineer, I thought.
In cracking this puzzle, I discovered that the best way to move
from novice to expert was to do the thankless tasks—for example,
helping with operational improvements. I had avoided these activ-
ities because they didn’t get my heart racing like R&D work. Why
would any “real” engineer want to maintain a build validation sys-
tem or create a testing framework? But it was precisely by serving my
team that I could transcend my own narrow realm of expertise. I did
tasks nobody else wanted: migrating infrastructure systems, resolving
product support backlogs, talking to external vendors, investigating
performance regressions. Along the way, I elevated my whole team,
gained broad expertise, and built strong personal relationships with
the veterans whose experience had intimidated me.
By doing these tasks well, I also gained a reputation as an ecient,
trustworthy and reliable engineer. e juicy work I’d wanted, but
hadn’t felt ready for in the past, now came automatically. I had
matured and proven that I wasn’t obsessed with just myself.
Other positive changes emerged. When I focused on others’
interests rather than my own, I blasted through roadblocks and
gained expertise rapidly. When my motivation was to help, I felt
comfortable approaching others with “stupid” questions and even
socializing with them. Being seless was simply more ecient!
I began operating at a new level. No longer trapped in an
obsessive race for fast promotions and more money, I made it my
goal to help others, and soon those same rewards started to come
easily. Today, if another colleague serves the team better, I see it as
an opportunity to contribute to her success and to learn from her.
A Beginner’s Mind
For a long time, I felt insecure about how much I didn’t know. e
more knowledge I consumed, the more expansive the universe of
things I didn’t know became. I wondered if a dierent industry, less
subject to drastic shis, would suit me better.
I struggled with the challenge of mastering a parade of new frame-
works and languages every year. My solution? I came to terms with
my lack of knowledge and sense of inadequacy.
For example, when asked to lead my team’s iOS eorts, I told my
manager that I was excited about the opportunity but intimidated
by my limited knowledge of the platform. I mastered iOS a little bit
at a time, and treated situations that exposed my iOS ignorance as
opportunities to enhance my knowledge so I could be more valu-
able to the team. I was open about what I didn’t know, and would
oen say, “I don’t know, but I’ll nd out.” (And I always did.) I found
that my team appreciated my vulnerability and follow-through.
I used to operate under the illusion that there’s a benefit to
being a know-it-all. ere isn’t. It’s OK to not know 90 percent of
a framework, extension, language, area, product or tool. I know
what’s relevant to me now, and I’m OK with having a “beginner’s
mind” for months or years—it keeps me curious and sharp! ere’s
always more to know in our eld. Instead of feeling driven by my
innate desire to master it all, I trust my intuition and explore only
what is driven by a sense of peace of mind. n
K
rishnan
r
angachari
has worked in diverse roles at large soware companies and
many Silicon Valley start-ups. He writes, speaks and advises on his passion: rigorous
career transformation for impatient high-achievers. Reach him at k@radicalshis.com.
The Yoga of Rookie Success
Upstart
KRISHNAN RANGACHARI
For a long time, I felt insecure
about how much I didn’t
know. The more knowledge I
consumed, the more expansive
the universe of things I didn’t
know became.
I discovered that the best way
to move from novice to expert
was to do the thankless tasks—
for example, helping with
operational improvements.
1015msdn_RangachariUpstart_v3_6.indd 6 9/14/15 8:48 AM