Quantcast
Channel: Visual Studio Blog
Viewing all 1076 articles
Browse latest View live

Developer update for Microsoft Band

$
0
0

It’s been a year since we launched Microsoft Band and Microsoft Health. We’ve made a commitment to the developer community to make our ecosystem open and accessible on every platform. Since then, we delivered three developer tools around our devices and services: Microsoft Band SDK, Microsoft Band Web Tiles, and Microsoft Health Cloud APIs. And as our devices and services evolve, we’re making continuous improvements to these tools.

With the recent announcement of the new Microsoft Band 2, we released updates to the Band SDK to add support for the new device. We’ve also released the official bits of Microsoft Band Web Tiles. Its preview bits went out in June this year. The new updated bits are available for download on our developer portal.

Microsoft Band 2

Updated Band SDK for Microsoft Band 2

In addition to enabling the existing SDK functionalities in Microsoft Band 2, we’ve enhanced the existing Microsoft Band SDK to take advantage of new sensors and specs of the new device. Here are the top enhancements:

  • Five new sensor-based subscriptions for Microsoft Band 2. In addition to nine sensor-based subscriptions exposed for both Microsoft Band and Microsoft Band 2, the updated SDK exposes five additional subscriptions that are only available for Microsoft Band 2: galvanic skin response (electrical conductivity of the skin in kohms), barometer, altimeter, RR interval (time between heart beat peaks), and ambient light.
  • Creation of PDF 417 barcodes with alpha/numeric data on Microsoft Band 2. The previous SDKsupported only 0-9 digits. The updated SDK extends support for more ASCII characters. For details, see the Microsoft Band SDK documentation.
  • Increased the icon limits for tiles on Microsoft Band 2. The updated SDK increases the icon limit for tiles from 8 to 13 for only Microsoft Band 2.

Download the latest update for the Microsoft Band SDK to start using these new features.

Microsoft Band Web Tiles

We launched a preview of the Microsoft Band Web Tiles in June this year. Now we’re excited to share the official release of Microsoft Band Web Tiles with more stable bits and new enhancements. Microsoft Band Web Tiles make it simple to deliver relevant information to the Band from virtually any data source accessible through the web. Developers have to write web tile code only once to support multiple mobile platforms (iOS, Android, and Windows) because the Microsoft Health app takes responsibility for doing the rest—installing the web tile to the Band, accessing web resources for content, extracting and formatting the content, and then delivering that content to the associated web tile on the Band.

In addition to stabilizing the preview bits that were released in June of this year, we added new web tile functionalities based on the feedback we’ve received. Here are the top things that we added to this release:

  • Creates simple conditions that trigger sending notification to web tiles. You can now make web tiles more informative for your users by sending notifications to the band whenever the web data meets predefined conditions. Want a weather web tile that notifies you when there’s a high chance of rain? You can create one now.
  • Extracts data from a web service that requires basic HTTP authentication. Until now, web tiles supported only publicly available web content. With the new update, web tiles can now support authenticated resources, opening up the opportunity to make the web content more secure and personalized.

Web tiles have no dependency on Band device version: the same web tile code works on both Microsoft Band and Microsoft Band 2.

For more information, visit the Microsoft Band Web Tiles developer website to read the updated developer documentation and download the sample web tiles. You can start creating new web tiles today using the Web Tile Authoring tool.

Feedback

We are making continuous improvements to our developer tools based on feedback. So please share your suggestions on the Microsoft Band Health UserVoice page. You can also vote on existing suggestions for improvements to any of our tools. You can also contact us through healthms (at) microsoft.com.

 

Maria Kang

Maria Kang, Program Manager, Microsoft Band and Microsoft Health

Maria Kang is on the Personal Devices team in Redmond, the creators of Microsoft Band and Microsoft Health. Since joining Microsoft in 2010, Maria has worked as a program manager in developer experience team on a number of Windows releases from Windows 8 through Windows 10. Most recently, she joined the Microsoft Band team to continue enhancing the developer ecosystem for Microsoft Band and Microsoft Health. She has a BS in Electrical Engineering.


Talk with our Apache Cordova Tooling team, live!

$
0
0

In the Visual Studio Tools for Apache Cordova team, we’re always looking for ways to connect with developers using our tools to create mobile apps. Starting next week, we’re taking a cue from the ASP.NET team and trying a new format – live, weekly, community question and answer sessions via our http://taco.visualstudio.com/live site.

We’ll be taking questions from attendees as well as responding to issues posted to Stack Overflow. To learn about our schedule and how to attend, visit the Cordova Tools Live Q&A website. We’re going to host these events for the next two months; based on feedback and attendance, we’ll decide if we continue it beyond that time.

As always, you don’t have to wait until the event to ask us questions – you can reach us directly on Twitter (@VSCordovaTools), email us (vscordovatools –at- microsoft.com), or report issues on StackOverflow (using the visual-studio-cordova tag).

We look forward to seeing you at one of our upcoming live streaming events!


clip_image002

Jordan Matthiesen (@JMatthiesen)
Program Manager, Visual Studio Tools for Apache Cordova

Jordan works at Microsoft on JavaScript tooling for web and mobile application developers. He’s been a developer for over 17 years, and currently focuses on talking to as many awesome mobile developers as possible. When not working on dev tools, you’ll find him enjoying quality time with his wife, 4 kids, 2 dogs, 1 cat, and a cup of coffee.

SAP Fiori Mobile Apps and Tools for Apache Cordova

$
0
0

Cordova makes it easy to build an app for iOS, Android, and Windows using web technologies. Although Blank project templates in Visual Studio Tools for Apache Cordova provide all the raw materials to build your basic “Hello World”, you have also told us that you would like to see richer starting points. We have covered starting points for frameworks like Ionic and Monaca in the past, but today we are going to take a look at how a major business platform company is working towards this goal with Cordova and Visual Studio: SAP.

SAP, SAP Fiori, and the SAP Mobile SDK

As the market leader in enterprise application software, SAP is at the center of today’s business and technology revolution. SAP's innovations enable more than 291,000 customers worldwide to work together more efficiently and use business insight more effectively. SAP is building their next-generation platform and business systems that include a strong focus on mobile based workflows as well as a distinctive set of design guidelines called SAP Fiori. In addition to end-user mobile apps for their business systems, SAP also offers an underlying platform and server infrastructure that enables developers like you to build custom apps that take full advantage of enterprise business data.

With over 500+ role-based apps, SAP solutions such as SAP S/4HANA, SAP Simple Finance, and the SAP Business Suite are applying SAP Fiori responsive design patterns to provide a personalized, responsive and simple user experience from either web or hybrid apps.

SAP Fiori Designs

The SAP Mobile Platform (SMP) and in particular the Mobile Platform Server and SDK enhances apps built using SAP5UI and Fiori Mobile UX by providing additional mobile device capabilities not available to traditional web apps. SAP provides multiple development options for mobilizing Fiori - SAP Web IDE, Cloud build or Custom Fiori client. Under the covers, these Fiori clients are built using a standard Apache Cordova Command Line Interface (CLI) project and a series of SAP built value-add Cordova plugins.

As a part of the collaboration between SAP and Microsoft, SAP plans to introduce some features to streamline development of SAP-powered mobile apps in Visual Studio. This blog post will cover the option of bringing Fiori apps to mobile devices through the creation of custom Fiori clients using Tools for Apache Cordova. Note thattoday Microsoft and SAP also announced that Microsoft Intune’s App SDK can be integrated with Fiori clients to add greater app level security controls when using Microsoft’s Enterprise Mobility Suite and will even be available in SAP’s cloud build service. You can expect even more in the future, so be sure to check out this video for more information!

SAP created the SAP Fiori Client to provide Fiori applications:

  • Additional native capabilities (such as Camera, Barcode Scanner, etc.) on top of what a typical browser provides
  • Management of the local web cache better when new versions of the application are released by the Fiori server
  • Additional security to protect the application from unauthorized access
  • Provisioning the user certificate through Mobile Secure and SAP Mobile Platform

With SMP, developers and IT staff can focus on delivering Fiori solutions to the business rather than building infrastructure. Enterprise requirements addressed by SMP include:

  • Enterprise authentication (single- or multi-factor), single sign on, network edge security, SSL, reverse proxy, remote access
  • Secure data at rest and data in motion, encryption
  • User/device registration, onboarding, managed rollout
  • Application lifecycle management
  • Offline Data, Mobile Database Integration and data composition for SAP and 3rd party back-end systems and databases
  • Central administration, Tracing and logging for end-user supportability
  • Horizontal scalability, high availability, usage statistics

Custom Fiori clients allow you to extend these base features and brand your Fiori client, add additional device capabilities by with Cordova plugins, remove plugins you do not intend to use to reduce your app’s size, and even add additional code packaged with the client app to meet your own specific needs (such as customizing your offline experience).

Tools for Apache Cordova

All editions of Visual Studio 2015 now come bundled with Tools for Apache Cordova which is designed to make it easy for you to build cross platform apps targeting Android, iOS, Windows, and Windows Phone using Cordova from one convenient IDE. Tools for Apache Cordova is “command line interoperable” which means that you can easily take a standard Cordova CLI project (like a Fiori client project) and further customize it to meet your needs. Once in Visual Studio you can take advantage of all of Visual Studio’s great cross-platform features like IntelliSense, integrated debugging for Android and iOS, and the high-speed Visual Studio Android Emulator.

Even better, you are able to use Team Foundation Server 2015 or Visual Studio Online for collaboration and continuous integration even when building an iOS version of your app or use Visual Studio Code to edit your project on a Mac. You can even take advantage of the cross-platform “TACO CLI” (Tools for Apache Cordova Command Line Interface) to simplify Cordova apps development using your favorite text editor.

Cordova Tools

Using Visual Studio on Windows to Build an App

The SAP Mobile SDK enables developers to build apps using Cordova through the integrated Kapsel SDK. The Kapsel SDK contains a set of Cordova plugins that you can add to your own Cordova project. In addition, the SDK provides a script to generate a Custom Fiori Client project ready for use.

To get started building your own Fiori client, follow these steps:

1. Download the latest SAP Mobile SDK (or a free trial from the SAP Store) and install it on your machine. (Ex: C:\SAP)

2. Follow the instructions in oursamples GitHub repo to generate a Custom Fiori Mobile Client project or to simply add a SAP Kapsel SDK plugin to your own Cordova app.

3. Install Visual Studio 2015, select the Tools for Apache Cordova option, and simply open the Cordova project you created in Visual Studio using the File > New > Project From Existing Code… menu item.

New project from editing code

You can currently build custom SAP Fiori clients for Android and iOS with Windows support expected in the future. Pick either Android or iOS, a device or emulator / simulator debug target, and click the debug button to see the app in action!

Selecting an Android emulator or device

 

App running in an emulator

Using Visual Studio Code on a Mac or Windows to Build an App

If you would prefer to use Visual Studio Code or your favorite text editor on Windows or a Mac:

  1. Follow the same instructions above to create your Cordova project
  2. Install the TACO CLI and use it to help you install any pre-requisites
  3. Simply open the folder containing your project in VS Code, start editing, and use the “taco” command to build and run as appropriate!

Using Apache Cordova in Visual Studio Code

Summary and the Future

SAP’s Mobile SDK combined with Tools for Apache Cordova can help you build quality, secure, and great looking SAP Fiori mobile apps faster than ever before. As a part of the collaboration between SAP and Microsoft, SAP’s roadmap includes Visual Studio support for building, debugging, and deploying fully “packaged” versions of Fiori apps along with integration with a cloud build service and Microsoft has some new and exciting capabilities already in the works.

You can expect much more from SAP and Microsoft in ensuring that you are able to build and deploy the high quality, secure apps for your enterprise needs in the future.

If you have not already, check out this video for more information!

You can find more information about SAP Fiori and how the SAP Mobile SDK can help you mobilize your business apps at SAP’s developer help portal.

You can find more information about Tools for Apache Cordova from the portal site. Microsoft is always interested in your feedback, so please contact the product team via UserVoice, Send-a-smile, Twitter, StackOverflow, or email.

 

Chuck Lantz

Chuck Lantz, Senior Program Manager, Visual Studio Client Tools Team

@chuxel

Chuck spent over 15 years as developer, advocate, and architect in a variety of mid and large scale enterprise IT shops. He brought his passion for app development to Microsoft in 2012 and is currently focused on mobile app development.

Kiran Karunakaran

Kiran Karunakaran, Director, Product Management at SAP

kiran.karunakaran (at) sap.com

Kiran is responsible for the product management, strategy and roadmaps for the SAP Mobile SDK and Fiori client. He has over 19 years of experience in architecture and development across multiple domains. He has been with the mobile platform team at SAP for the last four years.

Sanjeet Mall

Sanjeet Mall, Vice President, Engineering at SAP

sanjeet.mall (at) sap.com

Sanjeet is the Chief Architect for the SAP Mobile Platform team. He has been with SAP for more than 15 years and has worked on some of the key SAP products like SAP CRM, SAP Mobile Platform. He also runs the engineering organization responsible for Mobile SDK and Fiori client.

Announcing the Intune App SDK

$
0
0

One of the challenges enterprises face in a cloud-first, mobile-first world is protecting sensitive data in the face of an increasing number of business critical mobile apps running on employee owned devices. To help tackle these challenges, Microsoft’s Enterprise Mobility Suite (EMS) is designed to help organizations manage mobile devices and applications. This is achieved by helping organizations maintain a single identity across a number of apps and keep sensitive company and personal data protected not only on Windows but Android and iOS as well.

As a core part of EMS, the recent Microsoft Intune release includes improvements to their Mobile Application Management capabilities that will extend its policy management features to any custom or ISV app built using native technologies through the integration of the Intune App SDK. In addition, the team is pleased to announce that it is accepting applications for participating in a preliminary Intune App SDK beta for select customers targeting Cordova, and Xamarin based apps. Once available, you’ll be able to quickly add the SDK to your app from Visual Studio 2015 including cross-platform apps built with Tools for Apache Cordova or Xamarin.

The end result is that nearly any app will be able to take advantage of Intune’s comprehensive security features and centralized management functions. Administrators can require corporate credentials to be used to access the app, encrypt data on the device, restrict cut-copy-paste access, and more, right from the Intune console.

InTune Console

These capabilities complement Intune’s existing Mobile Device Management capabilities and an internal app store for Android, iOS, and Windows designed to provide piece of mind while still ensuring that deploying apps to employee or corporate owned devices is as simple as possible.

Mobile device management capabilities

The App SDK is already in use by a number of partners including SAP as profiled yesterday in this blog post and video.

Beginning today the Intune team is accepting requests for access to preview of the Intune App SDK for Cordova plugin in an upcoming preliminary beta for select customers. We are looking for companies interested in developing secure apps using Intune along with Cordova or Xamarin and are willing to try out early bits.

If you are interested, contact us today and, if accepted, You'll get the opportunity to participate in Insider Groups such as Intune app SDK for Cordova or Xamarin based on your interests. We’ll contact you via email using the information you provide and send you the Intune App SDK when it is ready to try with your technology of choice. Microsoft collects, handles, and uses that information in accordance with our privacy statement.

DownloadVisual Studio 2015 and sign up now!

 

Chuck Lantz

Chuck Lantz, Program Manager, Visual Studio Client Tools Team
@chuxel

Chuck spent over 15 years as developer, advocate, and architect in a variety of mid and large scale enterprise IT shops. He brought his passion for app development to Microsoft in 2012 and is currently focused on cross-platform mobile app development.

Sam Tulimat

Sam Tulimat, Program Manager, Microsoft Intune team
@samtulim

Sam works on the Microsoft Intune team at Microsoft's Boston office. He developed a love for technology when he started an internet Café in his home country of Syria. Later on he decided to bring his love for Entrepreneurship and tech to Microsoft by focusing on the fast evolving technology for app management and data protection in the enterprise.

Node.js Tools 1.1 for Visual Studio Released

$
0
0

Since our first stable release of Node.js Tools 1.0 for Visual Studio (NTVS) earlier this year, we have seen a lot of interest in this free extension. We are both humbled and excited by the response and community engagement on GitHub.

We’ve been hard at work developing interim releases with the support of our vibrant community. And today, we are pleased to announce that our next stable release of Node.js Tools 1.1 for Visual Studio is available for download. NTVS 1.1 supports Visual Studio 2012, 2013, 2015 (including the free Visual Studio Community Edition and Express for Web). To learn more about NTVS v1.1, visit Node.js Tools for Visual Studio on visualstudio.com.

We strive to make NTVS the best Node.js development experience out there by bringing the power of Visual Studio to allow developers to build enterprise-grade Node.js applications like a boss. Node.js Tools supports you at every stage of your application—from powerful code completions, to advanced debugging and profiling, to unit testing, cloud deployment, and much much more.

What’s new in v1.1?

Apart from support for Node.js v4.x and numerous bug fixes all across the product, we’ve focused on increasing developer productivity with the following improvements.

Faster and clutter-free IntelliSense

Apart from improving the overall code analysis performance, we have added a Quick IntelliSense mode and an easier way to classify browser and Node.js code for a clutter free IntelliSense experience to make it easier for full-stack developers to switch contexts between backend and frontend development.

Selecting ES6 IntelliSense

 Set as Content menu

This release includes an ES6 IntelliSense Preview powered by TypeScript.

More reliable debugging

Advanced debugging is the cornerstone of NTVS and we are committed to making it best-in-class. With this release we have made it even better by fixing several stability issues developers have reported in our earlier releases. So if breakpoints weren't working properly sometimes, or your app was having trouble running under the debugger, or things were generally inconsistent then hopefully this'll help. J

Node.js debugging in Visual Studio

Still running into problems? Please, please, pleasefile an issue on GitHub so we can work together to resolve it!

npm v3 support

Look familiar?

MAX_PATH issues with npm

<cue Professor Farnsworth> “Good news, everyone!”

npm v3 is officially out of beta , and one of the features we're most excited about is that dependencies are installed maximally flat, so you're less likely to run into MAX_PATH issues.

NTVS v1.1 brings full support for this latest version of npm in both solution explorer and the JavaScript analysis engine. Ready to give npm v3 a spin? Either follow the manual upgrade steps, or take advantage of the npm-windows-upgrade package from our friends at Microsoft DX.

Improved Performance

Slow project load times are a drag, but not anymore. We have significantly improved our performance during project load when the dependency tree is large. In some cases, we have seen over 80% gain in load times of large projects.

Code Snippets

Writing the same few lines of code over and over again gets annoying real fast. Support for Code Snippets is finally here to ease that pain. Simply press Ctrl+K+X to browse and select a snippet to insert, or type in the snippet name and press tab to complete it.

Node.js code snippets in Visual Studio

Write a great code snippet that you'd like to share? Let us know - we may be able to include it in the next update of NTVS.

And much more!

We’ve made improvements all across the product, including better code-completion defaults, improved formatting, unit testing, and support for the NTVS IoT extension, which enables developers to deploy Node.js as a Universal Windows Platform (UWP) application to Windows IoT Core devices like Raspberry Pi 2. Check out our release notes for the interim releases for a more comprehensive list of improvements.

Help make NTVS better

NTVS is a free and open source project, and this release simply would not have been possible without your support, so thank you, thank you, thank you to everyone who’s already active on our GitHub repo J.

We’re always willing to take high quality contributions. If you’d like to contribute, please check out our issue tracker for outstanding bugs and features which can be implemented. You can also help make NTVS better by reporting issues or helping out your fellow users on GitHub.

Get started with Node.js Tools 1.1 for Visual Studio

Download Node.js Tools 1.1 for Visual Studio to get started developing Node.js applications in Visual Studio. And as always… comments, compliments, or complaints? File an issue, join us on Gitter, or shoot us a tweet. We’d love to hear your feedback, especially if it comes in the form of a pull request.

Onwards!

image

Sara Itani (@mousetraps)

Sara is a Software Engineer on the Node.js Tools for Visual Studio. At first, she was skeptical about Node.js – that is, until she realized its full potential…. Now, she’s all in, and excited to help it take over the world by bringing the power of Visual Studio to the Node.js community. She, for one, welcomes our new JavaScript overlords. :-)

 

image

Arunesh Chandra (@aruneshc)

Arunesh is a Senior Program Manager at Microsoft working on Chakra, the JavaScript engine that powers Microsoft Edge, and Node Tools for Visual Studio. He is currently working on supporting Chakra’s integration with Node.js and helping ship new versions of Node.js Tools for Visual Studio.

News and Announcements at Connect(); //2015

$
0
0

Today we held the Connect(); //2015 event in New York, where we introduced many new products and features that we’ve been working on. In this post I’ll share the highlights with you, and you can watch the Connect(); event along with many additional on-demand videos on http://www.visualstudio.com/connect2015.

Visual Studio Code beta release. In this beta of Visual Studio Code we have done the following:

To find out more about the VS Code announcements visit the VS Code blog.

Visual Studio Code Beta


.NET Core 5 RC and ASP.NET 5 RC with Go-Live license.
The release candidates of both .NET Core 5 and ASP.NET 5 are now available for Linux, Windows, and OS X with a Go-Live license, so that you can start using it in production environments even though it’s still not at full release yet. ASP.NET 5 RC includes enhancements to both the runtime and tools with a simplified hosting model across Windows, OS X and Linux. You can read more about .NET Core on the .NET team blog, and more on ASP.NET 5 on the ASP.NET team blog and Scott Hanselman’s blog.


Visual Studio Online is now Visual Studio Team Services and extends its features.
We’ve changed the name of Visual Studio Online to Visual Studio Team Services to help make it clear in the name that these cloud development services have become a central part of agile team collaboration and DevOps services. New features in Team Services include a plugin for IntelliJ IDEA, a new customizable and task-based Build service, dashboards that provide visibility into a team’s progress, and preview extensions for Code Search, Package Management, and Release Management. The team has a number of posts on the Visual Studio ALM blog where you can explore all these improvements in depth.


Visual Studio Dev Essentials
is a new, free program that brings together everything developers need to create applications on any device or operating system including Visual Studio Community and Visual Studio Code, and the free tier of Visual Studio Team Services. Dev Essentials adds priority forum support, training services from Pluralsight, Wintellect, and Xamarin, and—something that many have asked for—monthly credits to use in Azure, which will be coming in early 2016. You can find all the details on https://www.visualstudio.com/products/free-developer-offers-vs.


Visual Studio cloud subscriptions.
Weare adding Visual Studio Professional and Enterprise monthly and annual subscriptions to our existing MSDN subscription lineup. Monthly subscriptions include the Visual Studio Professional or Enterprise IDE, access to Visual Studio Team Services with the optional Test Manager extension (for VS Enterprise subscriptions), and Team Foundation Server client access license. Annual subscriptions add benefits equivalent to those currently offered through MSDN subscriptions, including technical support incidents, Azure credits, Pluralsight training, access to dev/test software, a Windows developer account, Office ProPlus, an Office 365 developer subscription, Power BI Pro, and partner offers, depending on the subscription level. You can find all the details on https://www.visualstudio.com/products/subscriber-benefits-vs.

We’ll offer these subscriptions through the new Visual Studio Marketplace, giving you the convenience of a single bill for both subscription purchases and other Microsoft Azure cloud services like virtual machines and storage.


Visual Studio Marketplace.
We’ve had the Visual Studio Gallery for VS extensions for a long time. Today we’re announcing the Visual Studio Marketplace, a central place for developers to find, acquire, and install extensions for all editions of Visual Studio (Enterprise, Professional, and Community), for Visual Studio Team Services (formerly Visual Studio Online), and for Visual Studio Code.

The new Visual Studio cloud subscriptions, as well as the Test Manager extension for Visual Studio Team Services, are now available for purchase in the Marketplace. And at a future date, partners will be able to sell extensions in the Visual Studio Marketplace. Explorehttp://marketplace.visualstudio.com for more.


Visual Studio 2015 Update 1 and Team Foundation Server 2015 Update 1.
We’re closing in on the release of Visual Studio 2015 Update 1 and Team Foundation Server Update 1, which will both happen on November 30th.

I’ve previously shared details on this blog about the many features that we put out in the CTP and RC releases; in the full update you can look forward to even more like MS Test and Code Coverage support for ASP.NET 5, parallel test execution, improved code analysis, and an improved NuGet Package Manager experience, along with updated tools for the Universal Windows Platform. Watch this blog for the announcement on November 30th.

With Team Foundation Server, new features include dashboards that provide visibility to a team’s progress of work, code, tests and builds, Git and Team Foundation Version Control in the same team project, the ability to query Kanban columns and SonarQube Analysis build tasks work with on-premises and hosted agents. Brian Harry will let you know all about TFS 2015 Update 1 on his blog also on November 30th.


Xamarin 4 support
. We’re excited to announce that Visual Studio 2015 Update 1 will include Xamarin 4 support, providing an end-to-end solution to build, test, and monitor native mobile apps at scale with Visual Studio. Xamarin 4 includes updates to Xamarin Platform, notably rebuilt support for developing iOS apps in VS, making it more convenient to build, debug, and deploy Xamarin.iOS projects from Visual Studio. Xamarin now uses a SSH-based connection to simplify the Visual Studio-to-Mac network connection and provide a faster, more reliable connection over a well-known port. Configuring a Mac for Xamarin and Visual Studio only requires enabling Remote Login, and allows multiple Visual Studio instances to connect simultaneously, making it easier to work in multiple iOS projects at the same time. Xamarin 4 is a big release, with the Xamarin team investing hundreds of hours to improving the performance and stability of mobile development in C#. Visit the Xamarin blog to learn more and get started.


iOS Build with MacinCloud on Visual Studio Team Services.
We've partnered with MacinCloud to introduce a VS Team Services / VSO build agent plan. For organizations that prefer to not manage Macs in their datacenters or for smaller organizations that would prefer to not maintain dedicated Mac hardware for continuous integration, they can now use Team Services with MacinCloud to do their iOS builds. The plan is currently in preview at $30/month per agent with no limits on build hours. You’ll still need to sign up for the Apple Developer Program to obtain signing certificates and the necessary provisioning profiles to build and release your app, but a MacinCloud agent can be used with the free tier of Visual Studio Team Services through its one complementary "private" agent slot.

iOS build with MacinCloud

For details, visit the full ALM blog post, MacinCloud’s plan, the Xcode Build tutorial, the Cordova build tutorials, and this blog post on React Native.

Additional Announcements

  • Take an early peek at the nextmajor version of Visual Studio by watching the videos on http://www.visualstudio.com/connect2015. Features include a dramatically improved setup experience, lightweight installation options for any language, and innovation themes for the next version of C#.
  • Visual Studio Emulator for Android is coming to Mac OS X, enabling Android developers working either in OS X or Windows to use Microsoft’s fast, powerful and free Android emulator. You can sign up to be notified when the emulator is available on Mac OS X here. Plus, we’ve added new features in the Windows version of the emulator, including support for Marshmallow (API Level 23).
  • The HockeyApp extensionis available in the Visual Studio Marketplace, which enables developers to extend their existing DevOps workflow to their mobile apps. A free tier lets a single developer manage two apps with all the capabilities of HockeyApp.
  • Public Preview of Visual Studio GDB Debugger Extension, enabling Linux native remote debugging support in Visual Studio for Linux servers or IoT devices among others.
  • Node.js Tools for Visual Studio 1.1 RTM delivers higher developer productivity and Node.js v4.x support in Visual Studio.
  • Azure Service Fabric and Azure DevTest Labs in Public Preview.Azure Service Fabric helps developers build and operate microservice-based applications at scale with full integration with Microsoft Azure and Visual Studio. Azure DevTest Labs helps developers and testers quickly create environments in Azure while helping IT professionals minimize waste and control costs.
  • Azure SDK 2.8 for .NET includes updates to the Mobile Apps templates, big data tools for HDInsight customers, and updates to Docker and Data Factory tools. We’ve also announced new Azure Service Fabric tools for Visual Studio 2015 along with a standalone version a new client that runs on both the Windows and Mac desktops known as Storage Explorer.
  • Microsoft Graph (GA and Preview), described in detail on the Office Blog and Office Dev Blog and found on https://graph.microsoft.com, offers developers a consistent way to access data, intelligence and APIs within the Microsoft cloud, and with a single authorization token. Any developer capable of making an HTTP request can call the API from any platform, and once-siloed Office 365 services can now be directly navigated via the Microsoft Graph.
  • Additional updates for mobile development include CodePush Open Beta and the Intune App SDK, in addition to the partnership with MacinCloud (discussed earlier) that enables Visual Studio Team Services to build for iOS and other platforms in the cloud.
  • Docker tools for Visual Studio RC, enabling developers to work with Docker containers from Visual Studio target both Linux and Windows.
  • Azure diagnostics, now offered as part of Visual Studio Application Insights, provide system and infrastructure data in one place.

Again, you can enjoy the videos from the live announcements as well as more than 70 on-demand videos with additional details on https://channel9.msdn.com/Events/Visual-Studio/Connect-event-2015. And of course we’re already underway with future updates and releases. Let us know what you’d like to see by sharing your feedback, suggestions, thoughts, and ideas on UserVoice , through the in-product feedback UI, or file a bug through the Visual Studio Connect site.

 

John Montgomery

John Montgomery is the Director of Program Management for Visual Studio, responsible for product design and customer success for all of Visual Studio, C++, C#, F#, VB, TypeScript, JavaScript, and .NET. John has been at Microsoft for 17 years, working in developer technologies the whole time. Reach him on Twitter @JohnMont

Latest Microsoft Office Developer Tools for Visual Studio 2015

$
0
0

We’re pleased to announce that Update 1 for the Microsoft Office Developer Tools for Visual Studio 2015 is ready for you to install! This update includes a vocabulary change in our tools, Apps for Office and SharePoint are now known as Office and SharePoint Add-ins, and bug fixes, such as the Office/SharePoint node not appearing under Visual C# in the New Project dialog.

Second, we have also released a preview of the next round of improvements to these tools. We invite you to shape their future by giving us your feedback through Send-A-Smile or Microsoft Connect. You can start by trying out the new project types that you’ll see in this Preview release, as I’ll highlight in this post.

Follow these steps to install the Preview:

  1. If you don’t already have Visual Studio 2015, you can install Visual Studio Community 2015 at aka.ms/VSCommunity2015.
  2. Go grab the latest version with aka.ms/GetLatestOfficeDevTools.
  3. Head to the Download Center and install the Preview.
  4. Make sure you have Outlook 2016 installed.

New: Add-in Commands

In our Preview, we’ve added a new project type called Outlook Add-in with Commands to show off the new features in Office Add-ins. Add-in commands let you add a button on the Outlook ribbon to launch the add-in, display a menu, or execute a custom JavaScript function, providing a seamless Office experience for your users.

Outlook add-in commands

You declare commands in the manifest with a node called VersionOverrides that is be ignored by older versions of Office, thus ensuring backwards compatibility with all your users.

Now let’s walk through a scenario to create an add-in that inserts custom text when writing emails. When reporting issues, customer support workers typically need to ask for more details and give instructions on how to find versions, serial numbers, etc. It would be very handy—and save a lot of time—to have a button in Outlook to insert this kind of common text. We’ll step through an example to create an add-in that inserts custom text when writing emails.

In Visual Studio 2015, create a new Outlook Add-in with Commands project through File > New Project and selecting Templates > Office/SharePoint > Outlook Add-in with Commands:

Outlook add-in with Commands project in Visual Studio 2015

To see what the buttons look like, select the OutlookAddIn node in Solution Explorer, change the Start Action to Office Desktop Client in the Properties window, so the add-in will launch in Outlook 2016, and then press F5:

image

As you can see, our add-in can be launched by selecting the Display all properties button that now appears on our ribbon when we’re reading messages (the MessageRead surface defined in our manifest). Now we’re going to add a menu button to the ribbon for when we’re writing messages (the MessageCompose surface).

Stop the debugger and click on the OutlookAddInManifest node in Solution Explorer to open the manifest XML file.

Underneath the </ExtensionPoint> end tag, add an ExtensionPoint for the MessageCompose surface that contains everything for adding a menu button:

...

 

<ExtensionPointxsi:type="MessageComposeCommandSurface">

  <OfficeTabid="TabDefault">

    <Groupid="msgComposeDemoGroup">

      <Labelresid="groupLabel" />

      <Controlxsi:type="Menu"id="msgComposeMenuButton">

        <Labelresid="menuComposeButtonLabel" />

        <Supertip>

          <Titleresid="menuComposeSuperTipTitle" />

          <Descriptionresid="menuComposeSuperTipDescription" />

        </Supertip>

        <Icon>

          <bt:Imagesize="16"resid="icon16" />

          <bt:Imagesize="32"resid="icon32" />

          <bt:Imagesize="80"resid="icon80" />

        </Icon>

        <Items>

          <Itemid="msgComposeMenuItem1">

            <Labelresid="menuItem1ComposeLabel" />

            <Supertip>

              <Titleresid="menuItem1ComposeLabel" />

              <Descriptionresid="menuItem1ComposeTip" />

            </Supertip>

            <Icon>

              <bt:Imagesize="16"resid="icon16" />

              <bt:Imagesize="32"resid="icon32" />

              <bt:Imagesize="80"resid="icon80" />

            </Icon>

            <Actionxsi:type="ExecuteFunction">

              <FunctionName>addMsg1ToBody</FunctionName>

            </Action>

          </Item>

          <Itemid="msgComposeMenuItem2">

            <Labelresid="menuItem2ComposeLabel" />

            <Supertip>

              <Titleresid="menuItem2ComposeLabel" />

              <Descriptionresid="menuItem2ComposeTip" />

            </Supertip>

            <Icon>

              <bt:Imagesize="16"resid="icon16" />

              <bt:Imagesize="32"resid="icon32" />

              <bt:Imagesize="80"resid="icon80" />

            </Icon>

            <Actionxsi:type="ExecuteFunction">

              <FunctionName>addMsg2ToBody</FunctionName>

            </Action>

          </Item>

        </Items>

      </Control>

    </Group>

  </OfficeTab>

</ExtensionPoint>

 

...

In the Resources section at the end of the manifest, replace the ShortStrings and LongStrings nodes with the code below.

...

<bt:ShortStrings>

  <bt:Stringid="groupLabel"DefaultValue="My Add-in Group"/>

  <bt:Stringid="paneReadButtonLabel"DefaultValue="Display all properties"/>

  <bt:Stringid="paneReadSuperTipTitle"DefaultValue="Get all properties"/>

  <bt:Stringid="menuComposeButtonLabel"DefaultValue="Insert message"/>

  <bt:Stringid="menuComposeSuperTipTitle"DefaultValue="Choose a message to insert"/>

  <bt:Stringid="menuItem1ComposeLabel"DefaultValue="Insert custom message #1"/>

  <bt:Stringid="menuItem2ComposeLabel"DefaultValue="Insert custom message #2"/>

</bt:ShortStrings>

<bt:LongStrings>

  <bt:Stringid="paneReadSuperTipDescription"DefaultValue="Opens a pane displaying all available properties. This is an example of a button that opens a task pane."/>

  <bt:Stringid="menuComposeButtonTooltip"DefaultValue="Inserts your choice of text into body of the message."/>

  <bt:Stringid="menuComposeSuperTipDescription"DefaultValue="Inserts your choice of text into body of the message. This is an example of a drop-down menu button."/>

  <bt:Stringid="menuItem1ComposeTip"DefaultValue="Inserts custom message #1 into the body of the email." />

  <bt:Stringid="menuItem2ComposeTip"DefaultValue="Inserts custom message #2 into the body of the email." />

</bt:LongStrings>

...

Finally, add some custom JavaScript functions for the menu buttons at the end of functions/functions.js:

...

 

// Adds text into the body of the item, then reports the results to the info bar.

function addTextToBody(text, icon, event) {

    Office.context.mailbox.item.body.setSelectedDataAsync(text,
        { coercionType: Office.CoercionType.Text },

        function (asyncResult) {

            if (asyncResult.status == Office.AsyncResultStatus.Succeeded) {

                statusUpdate(icon, "\"" + text + "\" inserted successfully.");

            } else {

                Office.context.mailbox.item.notificationMessages.addAsync("addTextError", {

                    type: "errorMessage",

                    message: "Failed to insert \"" + text + "\": "
                       
+ asyncResult.error.message

                });

            }

 

        event.completed();

        });

}

 

function addMsg1ToBody(event) {

    addTextToBody("Custom message #1", "icon16", event);

}

 

function addMsg2ToBody(event) {

    addTextToBody("Custom message #2", "icon16", event);

}

Now run the add-in to see the new menu. Because we added the menu to the MessageCompose surface, you’ll need to create a new message by clicking the New Email icon in the top left of Outlook 2016 to open the Create a Message window.

Add-in appearing with a new message 

That’s it! You’ve successfully added your command to the add-in. To discover more, check out the Overview of add-in commands for mail and Create a manifest for add-in commands for a deep dive into how to add commands to your Office Add-in.

SharePoint 2016 Beta 2

Also available in our Preview are the templates for developing SharePoint farm and sandboxed solutions for SharePoint 2016 Beta 2. You can find these in the File > New Project dialog under Templates > Office/SharePoint >SharePoint Solutions:

Visual Studio 2015 project for SharePoint Solutions

Note that with the preview installed in Visual Studio 2015, opening an existing SharePoint solution targeting SharePoint 2013 will automatically prompt you to upgrade the project to target SharePoint 2016.

We’re working on our SharePoint 2016 Add-in support so keep an eye out in our upcoming releases. To keep up to date about what’s new in SharePoint 2016, check out the Office Blogs.

Learn More

To start developing with the Office platform, use the new dev.office.com/getting-started pages and learn about the Office 365 APIs and Office Add-in Model.

You can also:

If you have any questions or concerns, please let us know by leaving a comment below, through Visual Studio’s Send a Smile feature or via Twitter @nicoleabruck!

Nicole Bruck

Nicole Bruck, Program Manager, Office and SharePoint Tools
@nicoleabruck

Nicole is new to Microsoft and has just started as a program manager working with our Office Development Tools. Starting at the company as a developer intern in IT, she transitioned into a PM role full-time working on the Napa Development Tool and has since taken over more of the Visual Studio tooling for Office and SharePoint.

Visual Studio Update 1 RTM

$
0
0

Today we’re releasing Visual Studio 2015 Update 1. Let me be the first to thank everyone who installed these earlier releases, provided feedback, and helped us iron out the kinks. [The final release of Team Foundation Server Update 1 is also available today, which you can read about on Brian Harry's blog.]

I’ve already shared many of the features that we introduced in the CTP and the release candidate (RC), and you can find a complete list of features in Update 1 in the Visual Studio Update 1 RTM Release Notes. Let me now highlight the final additions made for RTM:

  • New Visual Studio Icon. Responding to your feedback on UserVoice, we’ve tweaked the Visual Studio 2015 icon in Update 1 to make it easier to differentiate visually between multiple versions of Visual Studio running side by side on the same machine:
    New icon for Visual Studio
  • .NET Framework 4.6.1. Visual Studio 2015 Update 1 includes the latest version (4.6.1) of the .NET Framework. You can read about all the new features on the .NET blog.
  • Editor support for new languages. The Visual Studio editor now provides built-in syntax highlighting and basic IntelliSense support for languages including Go, Java, Perl, R, Ruby, and Swift. We support the TextMate bundle
    model for language grammars and snippets, allowing you to extend this with support for other languages.

    Editor support for new languages (showing R)
  • IncrediBuild-Visual Studio partnership. With this collaboration and at no additional cost, developers can use IncrediBuild’s build engine to lay out build plans for their applications with more parallelized execution of the build. This leverages hardware resources more effectively and provides monitoring to identify bottlenecks and better understand resource usage. For complete details, see the post, Improving your build times with IncrediBuild and Visual Studio 2015.
  • Tools for Universal Windows Apps v1.2. This update enables you to build and submit apps to the Windows Store targeting Windows 10 SDK Version 1511. It includes several developer productivity improvements to .NET Native, the XAML designer, the manifest designer, Windows Store packaging, and the debugger in this release. If you don't already have Tools for Universal Windows Apps installed, you can enable them by modifying the Visual Studio 2015 installation, or directly installing them from http://go.microsoft.com/fwlink/?LinkID=619614.
  • Native support for behaviors in Universal Windows apps. Behaviors are an easy way of adding common interactivity to your XAML apps without having to add more imperative code. These are natively supported in Update 1, shipping as a NuGet Package (available for both managed and native projects), and accepting contributions as an open source project. The package can also be installed through the Blend Assets Pane (under “Behaviors”). Learn more from the XAML Behaviors, open source and on UWP post on the Windows Developer blog, start contributing by visiting the GitHub page, or request features by raising issues.
  • MSTest and CodeCoverage support for ASP.NET 5. The Visual Studio testing tools now support MSTest framework-based tests for ASP.NET 5 applications and add support for CodeCoverage with ASP.NET 5 on x86/x64 platforms targeting the CoreCLR/CLR. The MSTest framework components are available from the NuGet gallery.
  • Parallel Test Execution: The Visual Studio testing tools introduce support for parallel execution of test cases leveraging the available cores on the machine, with Test Explorer indicating the progress of parallel tests. The test execution engine is launched on each available core as a distinct process, and is given a container (assembly, DLL, or relevant artifact) with the tests to execute according to the semantics of the test framework. VS supports parallel execution through all launch points (e.g. the command line and IDE commands like Test Explorer, CodeLens, and various “Run” commands). For details on how to enable this feature, refer to the Release Notes.

    Parallel Test Execution feature showing tests running at the same time
  • C# Interactive Window and command-line REPL. We’ve added more functionality and fixed a number of bugs in these features that first appeared in the CTP. For RTM we’ve also cleaned up some of the command-line argument handling as described in the detailed notes on GitHub. (Note that NuGet support and the VB scripting API are not available with this release, but we’re still actively working on them. In the meantime, you can play with the C# scripting API available on GitHub.)
  • Managing analysis issues. We’ve heard from many customers that when they install a Roslyn analyzer from NuGet or Visual Studio Extensions, thousands of code analysis issues end up showing up in the Error List, leading them to abandon the analyzer. With this update you can now suppress all current issues to a global suppression file, view and manage baselined issues (to audit suppressions or review baselined issues), show analysis warnings and messages for only ‘my code changes,’ and remove duplicate instances of warnings in the error list to focus results to the unique set.

    Managing analysis issues
  • NuGet and NuGet Package Manager. NuGet 3.3 is now bundled with Update 1, and we’ve made a number of changes to the NuGet Package Manager interface including a tab-based UI to help filter groups of packages, action buttons in the package list for quick access to common management functions, a Consolidate tab for packages you work with at the solution level, and an Update tab that allows you to select and update multiple packages together.

    Updated NuGet package manager
  • Visual Studio license improvements. Signing in to unlock the IDE with your subscription is one of those features that you do not want to see interrupting your workflow. Towards this goal, Update 1 has improvements that will ensure the IDE stays unlocked for a year or more after signing in as long as you have regular access to the internet to keep the license renewed in the background. More improvements to reduce sign ins are still to come.

Again, for a complete list of features in Update 1 and information on bug fixes and known issues, see the Visual Studio 2015 Update 1 Release Notes.

Your continuing feedback is very important to us as we now start work on the next Visual Studio update. Share your feedback, suggestions, thoughts, and ideas on UserVoice, through the in-product feedback UI, or file a bug through the Visual Studio Connect site.

clip_image006[4]

John Montgomery is the Director of Program Management for Visual Studio, responsible for product design and customer success for all of Visual Studio, C++, C#, F#, VB, TypeScript, JavaScript, and .NET. John has been at Microsoft for 17 years, working in developer technologies the whole time. Reach him on Twitter @JohnMont


Improving your build times with IncrediBuild and Visual Studio 2015

$
0
0

IncrediBuild is a software acceleration technology that allows builds, tests, and other development processes to execute in parallel over a distributed network. It works locally on your development box and over a build server, and can also make use of idle CPU cycles in other computers over the entire network. In addition, developers with Visual Studio can use IncrediBuild to scale to the cloud via Azure to add more computing resources, substantially increasing performance, speeding up build time, and improving overall developer productivity. IncrediBuild is used by many Visual Studio customers today and is seen as a leader in the software acceleration technology space. Learn more about IncrediBuild at https://www.incredibuild.com or through is short Connect video about IncrediBuild.

With Visual Studio 2015 (both the RTM and Update 1 releases), developers see a Build Accelerator template in the File > New project dialog, which will install IncrediBuild:

Installing Incredibuild through New Project dialog

By installing IncrediBuild in Visual Studio through the Build Accelerator template, you can leverage the following features free of cost (these were previously available only as a part of the paid IncrediBuild SKU):

  • Predicted (Out of Order) Execution: Allows IncrediBuild to build more parallelized build plans by breaking down artificial dependencies, resulting in faster build times. Predicted execution also allows intelligent resource management and scales system resources according to your build needs.
  • Build Visualization: The build visualization tool, integrated into Visual Studio, helps developers see their overall build process, better understand the resource utilization of the builds, and easily identify bottlenecks for troubleshooting and optimization.
  • Parallelize up-to 8 cores: Allows developers to now use the free version of IncrediBuild across 8 cores on their development machines, bringing overall goodness!

In our internal test labs, we’ve seen a 10-20% improvements in most end-to-end application build times. The figure below, for example, illustrates build times achieved with predictive execution building across 8 cores on a single development machine for the popular C++ source-base Adaptive Computation Environment (ACE) Libraries:
Incredibuild improvements for a C++ project
We are really excited about this partnership with IncrediBuild and what it means for you! Learn more at https://www.incredibuild.com/microsoft-incredibuild-partnership.html, and through two Channel9 videos: What is Incredibuild? and Incredibuild with Visual Studio 2015 Update 1.

What is Incredibuild? (video link)  Incredibuild with Visual Studio 2015 Update 1 (video link)

We’d also love to hear your experience as you try this out in your development environments. Reach out to me directly via aasthan (at) microsoft.com.

clip_image006

Ankit Asthana, Senior Program Manager, Visual Studio
@ankitasthana86

Ankit's focus area is cross-platform mobile development along with native code generation tools. Ankit is also knowledgeable in compilers (dynamic and static compilation, optimizer, code generation), distributed computing and server side development. He has in the past worked for IBM and Oracle Canada as a developer building Java 7 (hotspot) optimization and telecommunication products. He is author of C++ for Beginners to Masters and graduated from McMaster University with a degree in Electrical Engineering.

Connect(“demos”); // 2015: HealthClinic.biz

$
0
0

image

During Connect(); //2015 we showcased many technologies available to you as a developer across Azure, Office, Windows, Visual Studio and Visual Studio Team Services. We’ve also heard from you that you love to have real-world applications through which you can directly experience what’s possible using those technologies. This year, then, we built out a full health and technology scenario for our Connect(); //2015 demos and are delighted to share all the source code with you:

image

HealthClinic.biz is a fictitious regular doctor practice specialized in offering healthcare preventive care. This clinic is using different Microsoft and multi-channel apps built with Visual Studio 2015 to grow their business and modernize the customer experience. They also innovate and offer multiple apps and services—including websites, mobile apps, and wearable apps—to empower their patient’s well-being with easy access to manage their healthcare data and stay healthy.

How we built the scenario

We built eight different demo projects in a couple of months using Visual Studio 2015 and Agile methodologies. We used Visual Studio Team Services to host our code repository and to manage our backlog, daily builds, and DevOps cycle across a number of different teams at Microsoft. And all the data, services, and notifications that bring the experiences and devices together are centralized in a variety of Azure services. Here’s how all that is structured:

Structure of HealthClinic.biz

Connect (“with your health”); Demo apps

The core apps in HealthClinic.biz are a public website, a private website, a WPF application for receptionists, a Universal Windows Platform app for patients, mobile apps for patients and doctors, wearable apps, and more! The following sections give a brief summary of each, which you can see in action during the Connect(); //2015 keynotes.

Public and Private Websites

The clinic has a public-facing or marketing site that provides info on the services and apps that the clinic offers. The clinic is also an enterprise and needs to manage doctors and patients in its database. The clinic thus has a private website used for patient/doctor data management and a dashboard to understand visit trends.

Public website

Public website for HealthClinic.biz

 

Private website

Private website for HealthClinic.biz

 

We built both websites using Visual Studio 2015 + ASP.NET 5.0 RC + Azure, with Glimpse and App Insights for monitoring and gathering telemetry.

You can see these apps in action @ Scott Hanselman’s keynote starting at 2:11.

Universal Windows Platform and WPF apps

For receptionists, we built a WPF app that lets them view the information they need. Similarly, we build a Universal Windows Platform app for patients. Both apps use a common Portable Class Library that results in approximately 80% shared client logic code between the apps. You can see more during Kevin Gallo’s demo starting at 1:07:50.

WPF receptionist app

WPF receptionist app for HealthClinic.biz

 

UWP patient app

UWP patient app for HealthClinic.biz

 

Cross-platform mobile apps, and wearables

For patients, we built a cross-platform mobile app using Xamarin so we could deliver a native look and feel and great performance on every device across iOS, Android, and Windows.

We built another app for doctors of the clinic using web technologies and the Visual Studio Tools for Apache Cordova. This allows 100% code reuse across devices, with Cordova plugins providing access to native device capabilities not available in a browser.

Patient mobile app (Xamarin)

Patient mobile app for HealtClinic.biz

 

Doctor mobile app (Apache Cordova)

Doctor mobile app for HealthClinic.biz

 

When patients want to schedule an appointment with their favorite doctor, they need to know when the doctor is available. These apps let patients create appointments in both the doctor’s Office 365 calendar and in their own Outlook.com calendar using same API, the Microsoft Graph API.

Of course, mobility is not only about smartphones and tablets. Wouldn’t it also be great if the doctors of this clinic could provide continuous service? Using Visual Studio 2015, we built an app that provides medication reminders for the Apple Watch and Microsoft Band 2 so patients can have assisted care throughout the day.

Apple Watch and Microsoft Band

 

Watch Amanda Silver’s keynote talk and demo starting at 1:16:55 where she shows the latest on mobile development, including native cross platform apps (Xamarin), hybrid cross-platform apps (Cordova), and wearables.

Even more apps

During their segment, Brian Harry and Donovan Brown demonstrated (starting at 16:30) how Visual Studio Team Services plus different extensions work together to create an awesome DevOps experience for devices and services. And for the grand finale, Scott Hanselman showed a smart end-to-end diabetes monitoring scenario. He used multiple cloud technologies including health data from Microsoft Health, his own glucose data in the cloud, Azure Machine Learning experiment data, and the Microsoft Graph API to get insights from his own personal health data, such as determining the most stressful times in his calendar. Let’s just say the common thread had something to do with a man in a red shirt.

Scott Hanselman's demonstration of personal health data using Azure

 

Download the code and contribute!

By now we hope you’re ready to get into the HealthClinic.biz code yourself, which you can download from GitHub. And we certainly invite you to help build out this scenario further to help many other developers realize solutions that can be built with the latest developer technologies to serve the many needs in our world today.

Download the code: HealthClinic.biz on GitHub

Enjoy!

image

Erika Ehrli Cabral, Senior Product Marketing Manager, Developer Tools

@erikaehrli1

Erika has been at Microsoft for over 11 years, working first in Microsoft Consulting and enjoying later on different roles where she created content and code samples for developers. In her current role she is now focused on executive keynote demos and Visual Studio and Azure product marketing.

The .NET Journey: Recapping the last year

$
0
0

Having just completed Connect(); // 2015, we thought to take a moment to review everything that’s happened with .NET over the last year, between last year's and this year's Connect();. And what a year it’s been! We’ve seen significant developments in the .NET Framework, including the release of new versions, and also the release of two new technologies, .NET Native and .NET Core, both of which will change the ways in which the .NET Framework is used and the platforms on which it is supported.

The .NET Framework 4.6

The .NET Framework version 4.6 was released in July with Visual Studio 2015 and is automatically installed on all Windows 10 systems. As the latest release of a mature product known for its robustness and ease of development, .NET Framework 4.6 offers improved app performance and a variety of individual feature enhancements:

  • A new version of the 64-bit JIT (Just-in-Time) compiler significantly enhances performance and supports SIMD hardware acceleration. A compiled app that targets x64 or anyCPU automatically takes advantage of the new JIT compiler when it runs on a 64-bit operating system.
  • Improved loading of assemblies decrease virtual memory.
  • Greater control over the garbage collector lets you disallow garbage collection during the execution of a critical path by calling GC.TryStartNoGCRegion and EndNoGCRegion. You can also use an overload of the GC.Collect method to control whether both the small object heap and the large object heap are swept and compacted or swept only.
  • The addition of SIMD-enabled vector types, such as Vector2, Vector3, and Vector4, Matrix3x2, and Matrix4x4, to the System.Numerics namespace.
  • Support for the Windows CNG cryptography APIs. The .NET Framework 4.6 adds the RSACng class to provide a CNG implementation of the RSA algorithm, a set of extension methods for X509 certificates, and enhancements to the RSA API so that common operations no longer require casting or type conversion.
  • Methods to convert the .NET Framework's DateTimeOffset values to Unix time.
  • An AppContext class, which allows library developers to provide a uniform way for users of their application to opt out of new features.
  • Task-based asynchronous pattern (TAP) enhancements, including convenience methods to return completed tasks in a particular state (such as Task.FromCanceled) and a new class, AsyncLocal<T>, that allows you to store ambient data that is local to a particular asynchronous control flow. In addition, for apps that target the .NET Framework 4.6, tasks inherit the culture of the calling thread.
  • Improved rendering in Windows Presentation Foundation (WPF) and Windows Forms. WPF also has improved support for touch.
  • In Windows Communications Foundation (WCF), support for TLS 1.1 and TLS 1.2 in addition to SSL 3.0 and TLS 1.0. You can also select the protocol to use, or disable less secure protocols, programmatically, and you can send messages using different HTTP connections.

There are also enhancements in networking, Windows Workflow Foundation (WWF), transaction processing, and code page encoding. For a complete list of new features and additional detail, see What's New in the .NET Framework.

The .NET Framework 4.6.1

The .NET Framework version 4.6.1 was released on November 30 and is automatically installed with the Windows 10 November Update. The .NET Framework 4.6.1 features performance and reliability improvements, as well as a handful of new features. As part of the ongoing work to modernize the cryptography API, the .NET Framework's cryptography API now includes support for Elliptic Curve Digital Signature Algorithm (ECDSA) X509 certificates. In addition, Windows Presentation Foundation features spell-checking improvements and additional support for per-user custom dictionaries, while Windows Workflow Foundation now supports a distributed transaction manager other than MSDTC.

In-place and side-by-side upgrades

The .NET Framework 4.6 or 4.6.1 is an in-place upgrades for the .NET Framework versions 4.0, 4.5, 4.5.1, and 4.5.2. In other words, if any of those other four versions are already installed on a system, installing the .NET Framework 4.6 or 4.6.1 replaces them.

The .NET Framework 4.6 or 4.6.1 is a side-by-side upgrade for systems with any versions earlier than the .NET Framework 4 (the .NET Framework versions 1.1, 2.0, or 3.5); in other words, the .NET Framework does not replace these versions but instead is installed separately. Applications that target these older versions of the .NET Framework run on the older version if it is present. If the original targeted version of the .NET Framework is not present, they can instead run on the .NET Framework 4.6 if the following entry is made in the app's configuration file:

<configuration>

  <startup>

    <supportedRuntimeversion="v4.0" />

  </startup>

</configuration>

Application compatibility with .NET Framework 4.6 and 4.6.1

Will an application developed for an earlier version of the .NET Framework run under the .NET Framework 4.6 or 4.6.1? The .NET Framework maintains an extremely high level of backward compatibility from one version to another. Almost all applications that target the .NET Framework 4 and its point releases will run without modification on the .NET Framework 4.6 or 4.6.1. For a list of changes that may require recompilation, along with an assessment of their significance and possible workarounds, see Runtime Changes in the .NET Framework 4.6 and Runtime Changes in the .NET Framework 4.6.1. Some changes only affect apps that explicitly target the .NET Framework 4.6 or 4.6.1, but provide a different behavior for apps that target a previous version; for a list of these, see Retargeting Changes in the .NET Framework 4.6 and Retargeting Changes in the .NET Framework 4.6.1.

.NET Native

.NET Native is a compilation and deployment technology for Universal Windows Platform (UWP) apps written in C# and Visual Basic. It uses and optimized implementation of .NET Core (discussed in the next section) and compiles apps to native code. In other words, it compiles an app running on an ARM system to the ARM instruction set, and it compiles an app running on an x64 system to the x64 instruction set. This differs from most .NET Framework applications, which are compiled to intermediate language (IL) before they are deployed, and then are compiled to native code at runtime by the Just-In-Time (JIT) compiler.

Selecting the .NET Native options

.NET Native produces small, compact binaries that load and start up quickly. It statically links only those code elements from the .NET Framework Class Library and any other libraries you may use. Code paths that are not executed by your application are not linked into the binary. Along with your application code, .NET Native produces a small app-local runtime whose primary responsibility is memory management and garbage collection. For more information on .NET Native's compilation technology, see .NET Native and Compilation.

Normally, the .NET Framework Class Library includes rich metadata about each assembly, type, and member. When compiling apps to native code, however, .NET Native includes only the metadata that an app actually needs at runtime. For some reflection and serialization scenarios, the .NET Native tool chain may be unable to detect that it needs specific metadata. You can identify these scenarios and ensure that the .NET Native tool chain includes all the necessary metadata at runtime by testing the release version of your app and defining the required metadata in a runtime directives file. In addition, two troubleshooters that help supply the runtime directives needed to reflect on or serialize types and type members are available.

By default, the release builds of all UWP apps written in C# or Visual Basic are compiled to native code with the .NET Native tool chain. For faster compilation and ease of debugging, however, debug builds are not compiled with the .NET Native tool chain. This makes it important to thoroughly test the release builds of your app on each of its target platforms.

For more information about creating UWP apps that are compiled to native code, see Getting Started with .NET Native.

.NET Core

.NET Core is a modular, cross-platform, open source implementation of the .NET Framework that will run on Windows devices, as well as on Linux and Mac OSX. Unlike the .NET Framework, .NET Core consists of a set of runtime, library, and compiler components that can be used in various configurations, depending on the needs of your application.

To get a better sense of what .NET Core is, let's compare it to the.NET Framework 4.6:

.NET Framework

.NET Core

A sizable runtime, the CLR, that provides memory management and a host of other application services.

CoreCLR, lightweight runtime that provides basic services, particularly automatic memory management and garbage collection, to your app, along with a basic type library.

The .NET Framework Class Library, a large, monolithic library with thousands of classes and many thousands of members. Whether or not your application uses individual types and their members, they are always present and accessible.

CoreFX, a set of individual modular assemblies that you can add to your application as needed. Unlike the .NET Framework 4.5, where the entire .NET Framework Class Library is present, you can select only the assemblies that you need. That the assemblies are local to your application solves versioning problems and reduces the overall size of your applications. For example, if you are developing a vector-based application, you can download the System.Numerics.Vectors package without the overhead of a large class library.

Suitable for developing traditional Windows desktop applications.

Suitable for a full range of modern applications that operate on small devices with constrained memory and storage.

Aside from a basic setup procedure, each CoreFx module is independently downloadable as a NuGet package from the CoreCLR GitHub repo.

For more information on .NET Core, see Introducing .NET Core. For the basic .NET Core documentation set, see .NET Core: A General Purpose Managed Framework.

We hope you’ve enjoyed this recap of everything that’s happened in .NET over the last year. As always, we invite your feedback, suggestions, thoughts, and ideas on UserVoice, through the in-product feedback UI, or file a bug through the Visual Studio Connect site

Ron Petrusha

Ron Petrusha is a programming writer on the .NET Framework team. He is also the author or co-author of a number of computer books, including Inside the Windows 95 Registry, VBScript in a Nutshell, and Visual Basic 2005: The Complete Reference.

Installing the Unreal Engine in Visual Studio

$
0
0

As previously announced, Visual Studio has partnered with some of the most popular game engines to bring you an easy acquisition experience for game development tools.  Today we are pleased to confirm that we now provide the ability to acquire and install the Unreal Engine directly from the IDE. 

What is Unreal Engine?

The Unreal Engine is a cross-platform game engine targeting DirectX 11 and 12 for PC and Xbox, OpenGL for iOS, OS X and Android, and WebGL for the Web.  Console development on Xbox One and PlayStation 4 is also available on the Unreal Engine for registered developers of those platforms. Unreal Engine also supports virtual reality development targeting platforms including Oculus, PlayStation VR, SteamVR and Gear VR.

Unreal Engine games can be programmed using C++ and Unreal’s visual scripting framework called Blueprints.  Visual Studio serves as a powerful code editor and debugger when using C++ for Unreal development. 

Unreal C++ code inside Visual StudioUnreal C++ code inside Visual Studio

Visual scripting with BlueprintsVisual scripting with Blueprints

Getting Started

From Visual Studio you can open up the new project dialog using the FileàNew Project option and navigate to the installed templates, under which there will be a Game folder.  Inside you will see the options that Visual Studio currently provides for creating a game, which now includes Unreal Engine. The Unreal Engine template will not appear if Unreal Engine is already installed on your machine.

Visual Studio template item to install Unreal Engine

Selecting this template will automatically launch a series of dialogs that will guide you through the Unreal Engine installation.

Unreal Engine installer

After selecting install, the Visual Studio installer will launch with the Unreal Engine checked.  Click the Next button and you will be presented with a link to the Unreal Engine license, where clicking Update verifies that you have read and accept those terms and continues with the rest of the installation.

Visual Studio install options for Unreal Engine

Gametime

One the installer has completed, the Unreal application will launch and you are now ready to start making games!

UI of the Unreal Engine application

For more information on Unreal development, check out the following resources:

Getting Visual Studio Setup

Unreal Development Docs

Cheers,

The Visual Studio Team @ Microsoft

Adam Welch

Adam Welch, Program Manager, Visual Studio Team

Adam joined Microsoft in 2012 after graduating college, fueled by his passion for software development and game design. He has worked on the Visual C++ debugging and diagnostic tools, including the native memory profiler, and more recently began focusing on game development tools for Visual Studio.

Unit Testing Apache Cordova Apps with Visual Studio, Part 1

$
0
0

See Part 2 of this series.

Great apps—like great artists, actors, and athletes—are great performers. Human beings validate and continually improve their performances through extensive training, practice, rehearsals, and after-the-fact reviews. We achieve these same ends in software development through many levels of rigorous testing—or continuous validation—across the entire app lifecycle.

Chances are you’ve heard about unit testing, but you might not be clear on what it is, exactly, and how it fits into a cross-platform app project build with Apache Cordova. In the documentation for the Visual Studio Tools for Apache Cordova, we’ve recently added a whole section Author & run tests to explore the details of unit testing with Cordova apps through a series of comprehensive examples.

In this two-part post I’ll give a shorter version of those walkthroughs to familiarize you with the process. Part 1 here provides background on unit testing and a basic example with Cordova and Visual Studio. Part 2 will delve a little deeper into the subject of test-driven development and debugging unit tests.

 

Unit testing vs. other forms of testing

Unit testing is unique from other forms of manual and automated testing in a number of ways:

Unit Testing

Other Testing

Tests “units” of app code (classes, methods, properties, and functions) by calling/using them directly.

Tests the built app that’s been deployed to emulators or tests device through its user interface.

Is aware of how the app code is written (“white box testing”)

Is not aware of how the app was written (“black box testing”)

Tests are run on development and build machines via a test runner (for example, an independent JavaScript runtime like Node.js).

Tests are run on emulators or physical devices.

Tests are themselves pieces of code (typically written in the same language as the app code, e.g. JavaScript)

Tests are scripts (written manually or generated by a recorder) or are simply a set of steps that a tester performs manually.

Occurs early in the dev cycle, alongside coding or even before coding begins (test-driven development).

Occurs after a successful build of the app.

Ideally run very quickly so they can be performed with each build, which helps to quickly catch regressions introduced with code changes.

Are not time-sensitive (depending on one’s release management process)

Failed tests invalidate builds or commits to version control repositories.

Failed tests invalidate steps in a release management process.

 

The following figure illustrates how most forms of app testing (left) differ from unit testing (right), and illustrates that unit tests are typically run outside the app platform itself.

 

Note: when you set out to do unit testing, focus wholly on the code that you write or modify. You need not test libraries or other code you’re importing into a project but not modifying, as the authors of those libraries should have already tested them. If tests are lacking for a library you want to use, the right place to do that work is in the library’s source repo, not in your project.

 

Unit testing environments for JavaScript and Apache Cordova

A unit testing environment consists of the three components: the runtime, a test framework, and a test runner. The following table describes these and gives some examples.

Component

Description

Examples for JavaScript

Runtime

Loads and executes code being tested outside the app. This can happen in a browser or a separate runtime sometimes referred to as a “headless browser.”

Browsers, or Node.js, PhantomJS, Chrome V8

Test framework

Defines how to write pieces of code that are specifically identified as “tests,” typically in the same language as the code being tested so they can share the same runtime, but this is not required.

Jasmine, QUnit, Mocha along with libraries like Chai and assert.js

Test runner

Executes tests defined by a supported framework within a supported runtime, and produces test reports.

Chutzpah (uses PhantomJS), Karma (uses a browser)

 

All of these relationships are illustrated below:

 

 

Unit testing is then a matter of invoking the test runner at appropriate times and viewing the reports. This can be done manually or as part of an automated build process, and the test runner might be invoked through the command line or through integration with the Visual Studio IDE.

Some test runners, like Chutzpah, have a Visual Studio test adapter that integrates the tool and its reporting into Visual Studio’s Test Explorer. Other test runners, like Karma, don’t have a test adapter but can still be integrated into Visual Studio’s Task Runner Explorer in conjunction with tools like Grunt and gulp. Both options are covered in the documentation; for Karma and gulp, see Basic unit testing and Test Apache Cordova apps with Karma and Jasmine.

 

Unit testing in action

To better understand the mechanics of unit testing, let’s now follow a piece of code and an associated unit test through the basic process with Chutzpah, QUnit (jQuery’s unit test framework), and Visual Studio.

The “unit”

First, assuming you have the Visual Studio Tools for Apache Cordova installed, create a new app project through File > New Project, selecting JavaScript > Apache Cordova Apps > Blank App. Then in the www/scripts folder create a file called normalize.js with the code below.

/** @description Converts JSON data that may contain Name and PersonalIdentifier 
 *    properties to an object with the properties name (string) and id (positive 
 *    integer up to 9999999999.
 * @param {string} jsonIn The JSON data to normalize.
 * @return {object} An object with name (string) and id (integer) properties,
 *    defaulting to "default" and 0, or null if the JSON is null or invalid.
 */
function normalizeData(jsonIn) {
}

This simple normalizeData function is the “unit” we’ll be testing, and we’ll leave it empty for the moment. Understand that this code is strictly part of the app’s functionality: it has nothing whatsoever to do with our choice of test framework or test runner.

The unit tests

Next, each unit test is a piece of code that validates a unit by:

  1. Calling it with specific inputs, and,
  2. Checking the output against the expected value.

A unit test must follow the conventions of the test framework you’re using. Because we’re testing JavaScript code, it’s easiest to use one of the many JavaScript test frameworks available to us. For this example, we’ll use the one called Jasmine. It enjoys built-in support with the Chutzpah test runner that we’ll be using shortly, so we don’t need to install anything for Jasmine specifically.

For the unit tests, create a folder named test in the project, then create a file in that folder called normalize_tests.js with the following contents:

// First argument to "describe" is the name of this group of tests
describe("normalizeData tests", function () {
    // First argument to "it" is the name of the specific test
    it("accepts golden path data", function () {
        // Use the unit being tested as necessary
        var json = '{"Name": "Maria", "PersonalIdentifier": 2111858}';
        var norm = normalizeData(json);

        // Check the results; "expect" is a Jasmine method.
        expect(norm.name).toEqual("Maria");
        expect(norm.id).toEqual(2111858);
    });
});

In Jasmine, you create a group of tests with its describe method, and each test is a call to a function named it, which ends up reading quite well with the description of the test itself. Within each test you use the unit code however you want, and then check results with Jasmine’s expect method that generates the appropriate pass/fail report output.

We have just one simple test to start with here, but notice how it’s specific: it calls the unit under test with one set of inputs and gives an exact name/description for the test with those inputs. This follows the best practice of isolating each unit test to an individual test case, creating a 1:1 mapping between the name of the test, as it appears in reports, and the exact test case (that is, the arguments used in the test). When the test runner reports a failure, then, you know exactly where to look in your code and can easily step through that one test in the debugger to isolate the failure. This saves you time in the end, because if you combine tests, you’ll have to debug the whole set to find the one that failed, and you’ll likely end up separating all the tests anyway.

 

The test runner

With unit code and at least one unit test in place, we can now run the tests with the Chutzpah test runner. To install it, go to Tools > Extensions and Updates… in Visual Studio, select Online, then search for and install the “Chutzpah Test Adapter” (you’ll be prompted to restart Visual Studio):

 

To tell Chutzpah about the files it should work with, create a Chutzpah.json file in the project’s root folder with the following contents:

{
  "References": [
    { "Path": "www/scripts/js/normalize.js" }
  ],

  "Tests": [
      { "Path": "test/normalize_tests.js" }
  ]
}

The “References” section clearly identifies the code to test and the “Tests” section identifies the unit test files. You’d obviously list more code and test files as you add them to a project.

Now select Test > Windows > Test Explorer and you should see the available tests listed there:

 

Note: if nothing appears, there are likely syntax errors in your test files which prevent Chutzpah from finding those tests.

Click Run All to build the project, run the tests, and see the results. Because we don’t have any implementation in normalizeData, the test should fail:

 

This verifies that you have the mechanics of using Chutzpah working within Visual Studio.

If you’d like to make the test pass, implement normalizeData soit at least handles expected inputs and run the test again:

function normalizeData(jsonIn) {
    data = JSON.parse(jsonIn);
    return {
        name: data.Name,
        id: Number(data.PersonalIdentifier)
    };
}

Of course, this code can’t handle anything other than perfect JSON, so there’s definitely room for improvement! We’ll pick up that story in Part 2 where we’ll talk about test-driven development and debugging unit tests.

In the meantime, I’d love to hear how you work with unit testing in Cordova apps, how you’re working with UI testing (both manual and automated), and how we can further improve our support through the Visual Studio Tools for Apache Cordova. Add a comment below, drop me a line at kraigb (at) microsoft.com, or submit suggestions via http://visualstudio.uservoice.com/.

Happy testing!

See Part 2 of this series.

clip_image010

Kraig Brockschmidt, Senior Content Developer, Visual Studio

@kraigbro

Kraig has been around Microsoft since 1988, working in roles that always have to do with helping developers write great software. Currently he’s focused on developing content for cross-platform mobile app development with both Xamarin and Cordova. He writes for MSDN Magazine, is the author of Programming Windows Store Apps with HTML, CSS and JavaScript (two editions) and Inside OLE (two editions, if you remember those) from Microsoft Press, occasionally blogs on kraigbrockschmidt.com, and can be found lurking around a variety of developer conferences.

Unit Testing Apache Cordova Apps with Visual Studio, Part 2

$
0
0

Part 1 of this post provided some background on unit testing with a basic example in Visual Studio for an app written with Apache Cordova. In this post we’ll make many improvements to that example using the process of test-driven development, which helps you separate the process of thinking about how to challenge a unit of code to fail from the process of coding that unit to make it not fail! We’ll also discuss a little about debugging unit tests.

Again, these two posts are a shorter version of walkthroughs that we’ve recently added to the documentation for the Visual Studio Tools for Apache Cordova, in the section Author & run tests.

 

Test-driven development

It should be obvious that having one test for an empty (or overly simplistic) implementation of normalizeData is woefully inadequate. A robust normalizeData needs to handle all sorts of bad JSON that would cause utility functions like JSON.parse and/or property dereferences to fail. And of course we need to have tests that exercise all the data variations we can think of.

Question is, where to start? Write code, write tests, or go back and forth between the two? You’ve probably done plenty of the latter: write some better code into normalizeData, then write some tests, examine cases that fail, then write more code, write more tests for cases you haven’t covered yet, correct the code again, and so on. Although this is manageable, it forces you to switch back and forth between thinking about code and thinking about data, and switching between trying to make the code work properly and thinking up ways to make it fail. These really are two different mental processes!

This is where the approach of test-driven development shows its value. To fully exercise any piece of unit code, you eventually have to think through all the necessary input variations. Test-driven development does this thinking up front, which is very efficient because once you think of a few tests cases, you can quickly see additional ones. For example, if you think to include an object inside a piece of JSON, you’ll naturally think to include an array as well. If you think to include an integer where the unit code might expect a string, it’s natural to also try a string where it expects an integer.

With the normalizeData function, I found it took perhaps 15 minutes to think through a strong set of test inputs with different challenges to JSON.parse, challenges to assumptions about the structure of valid JSON, and challenges to assumptions about data types. Here’s that list:

'{"Name": "Maria", "PersonalIdentifier": 2111858}'
null
''
'blahblahblah'
'{{}'
'{{[]}}}'
'document.location="malware.site.com"'
'drop database users'
'{"Name": "Maria"}'
'{"PersonalIdentifier": 2111858}'
'{}'
'{"name": "Maria", "personalIdentifier": 2111858}'
'{"nm": "Maria", "pid": 2111858}'
'{"Name": "Maria", "PersonalIdentifier": 2111858, "Other1": 123, "Other2": "foobar"}'
'{"Name": "Maria", "PersonalIdentifier": "2111858"}'
'{"Name": "Maria", "PersonalIdentifier": -1}'
'{"Name": "Maria", "PersonalIdentifier": 123456789123456789123456789123456789}'
'{"Name": , "PersonalIdentifier": 2111858}'
'{"Name": 12345, "PersonalIdentifier": 2111858}'
'{"Name": {"First": "Maria"}, "PersonalIdentifier": 2111858}'
'{"Name": "Maria", "PersonalIdentifier": {"id": 2111858}}'
'{"Name": {"First": "Maria"}, "PersonalIdentifier": {"id": 2111858}}'
'{"Name": ["Maria"], "PersonalIdentifier": 2111858}'
'{"Name": "Maria", "PersonalIdentifier": [2111858]}'
'{"Name": ["Maria"], "PersonalIdentifier": [2111858]}'
'{"Name": "Maria", "PersonalIdentifier": "002111858"}'
'{"Name": "Maria", "PersonalIdentifier": 002111858}'

Again, once you get thinking about input variations, one test case naturally leads to another. And once you’ve worked out JSON variations for one unit test, you’ve essentially created a reusable asset for any other function that takes JSON, in whatever project.

With the input list in hand, it’s now a simple matter—with a lot of copy and paste!—to wrap the necessary test structure around each set of inputs. For example:

it('accepts golden path data', function () {
    var json = '{"Name": "Maria", "PersonalIdentifier": 2111858}';
    var norm = normalizeData(json);
    expect(norm.name).toEqual("Maria");
    expect(norm.id).toEqual(2111858);
});

it ('rejects non-JSON string', function () {
    var json = 'blahblahblah';
    var norm = normalizeData(json);
    expect(norm).toEqual(null);
 });

it('accepts PersonalIdentifier only, name defaults', function () {
    var json = '{"PersonalIdentifier": 2111858}';
    var norm = normalizeData(json);
    expect(norm.name).toEqual("default"); //Default
    expect(norm.id).toEqual(2111858);
});

it('ignores extra fields', function () {
    var json = '{"Name": "Maria", "PersonalIdentifier": 2111858, "Other1": 123, "Other2": "foobar"}';
    var norm = normalizeData(json);
    expect(norm.name).toEqual("Maria");
    expect(norm.id).toEqual(2111858);
});

it('truncates excessively long Name', function () {
    //Create a string longer than 255 characters
    var name = "";
    for (var i = 0; i < 30; i++) {
        name += "aaaaaaaaaa" + i;
    }

    var json = '{"Name": "' + name + '", "PersonalIdentifier": 2111858}';
    var norm = normalizeData(json);
    equal(norm.Name).toEqual(name.substring(0, 255));
    equal(norm.Name.length).toEqual(255);
    expect(norm.id).toEqual(2111858);
});

it('rejects object Name and PersonalIdentifier', function () {
    var json = '{"Name": {"First": "Maria"}, "PersonalIdentifier": {"id": 2111858}}';
    var norm = normalizeData(json);
    expect(norm).toEqual(null);
});

Note that the test names (the first argument to it) are what appear in UI like Test Explorer, so they should always identify what’s being testing and the basic nature of the test (e.g. “rejects” or “accepts”). Also, it’s certainly possible to put inputs and expected results into an array and iterate that collection instead of writing each test individually. I’ve just left everything explicit here.

The point here is that by first spending something like 30 minutes of focused work on input variations and wrapping them in unit tests, you’re now entirely free to focus on writing the code without having to wonder (or worry!) whether you’re really handling all the possible inputs.

In fact, if you run all these tests against an initially empty implementation of a function like normalizeData, many or most of them will clearly fail. But that just means that the list of failed tests is your to-do list for coding, mapping exactly to the subset of input cases that the function doesn’t yet handle properly. You improve the code, then, to pass more and more tests. When the function passes all the tests, you can be completely confident that it can handle all the possibilities it should. For a full walkthrough, which includes the completed implementation of normalizeData, see Improving the unit tests: an introduction to test-driven development in the documentation.

Test-driven development, in short, cleanly separates the task of coming up with input cases from the task of writing the code to handle those cases. Ultimately, if you’re going to do a really good job testing your code, you’ll have to separate these tasks one way or another. By acknowledging this up front, test-driven development can result in more robust code earlier in the development process, which can reduce your overall costs.

 

Debugging tests and runtime variances

One of the unit tests shown in the previous section is buggy. Do you see which one? I thought I’d written a complete implementation of normalizeData, which included code to handle the 'truncates excessively long Name' test case, but that case was still failing and I couldn’t see the problem right away.

Fortunately, Visual Studio gives you the ability to debug unit tests just like you can debug any other kind of code, with the ability to set breakpoints, examine variables, and step through the test code. Unit test code is still code, after all, and just a prone to bugs!

Setting breakpoints in the Visual Studio editor isn’t enough, however. Running tests through Test Explorer doesn’t pick up those breakpoints because a test runner like Chutzpah is spawning separate PhantomJS processes to load and execute all the JavaScript, but the Visual Studio IDE doesn’t have debug hooks into that engine.

You have instead use the Test > Debug > Run menu, where you’ll find options for Selected Tests and All Tests. You can also right-click a failed test and select Debug Selected Tests. Any of these commands will, for JavaScript, instruct the test runner to execute code in a browser, to which Visual Studio can attach the debugger. Reports from the test framework will also appear in the browser.

Gotcha alert! The Test > Debug > Run > All Tests and Test Explorer > Run All commands automatically save any files that you’ve modified in the project. However, commands that run individuals tests, do not save changed files, which can lead to some confusion when an expected change isn’t picked up. So be sure to save prior to running individual tests.

In the debugger, I was able to see that my unit test mistakenly tries to dereference norm.Name rather than norm.name:

After this fix I had just a single remaining test to satisfy, one that tested having a leading zero on an integer value in the JSON. I wasn’t sure why it was failing, so I started the debugger for that test as well. But in the debugger, the test passed! What was going on?

Turns out that I found a small difference between the implementation of JSON.parse in the PhantomJS runtime, which was used when running tests outside the debugger and throws an exception with the leading zero, and the Internet Explorer runtime, which was used during debugging and is just fine with the leading zero. See the topic Debugging unit tests in the documentation for that story!

What’s important to keep in mind here, is that you may find a few similar differences between the runtime used for unit testing and the platform runtime used when the app runs for real. For this reason it’s a good idea to occasionally run all your unit tests on each mobile platform. To do this, adding a special page to a debug build of your app that runs tests when you navigate there. In this case, the act of navigation serves as the test runner, and you’ll need to explicitly reference the test framework libraries so that they’re loaded for that page.

 

Closing

That wraps it up for parts 1 and 2 of this post, which is again a shorter version of content that we’ve published in the Author & run tests section of the documentation. There you’ll find more detailed walkthroughs, along with a discussion about using “mocks” to handle calls to platform APIs and other external dependencies that the unit testing runtime won’t have access to. Let us know what you think!

I’d also love to hear how you work with unit testing in Cordova apps, how you’re working with UI testing (both manual and automated), and how we can further improve our support through the Visual Studio Tools for Apache Cordova. Add a comment below, drop me a line at kraigb (at) microsoft.com, or submit suggestions via http://visualstudio.uservoice.com/.

Happy testing!

clip_image010

Kraig Brockschmidt, Senior Content Developer, Visual Studio

@kraigbro

Kraig has been around Microsoft since 1988, working in roles that always have to do with helping developers write great software. Currently he’s focused on developing content for cross-platform mobile app development with both Xamarin and Cordova. He writes for MSDN Magazine, is the author of Programming Windows Store Apps with HTML, CSS and JavaScript (two editions) and Inside OLE (two editions, if you remember those) from Microsoft Press, occasionally blogs on kraigbrockschmidt.com, and can be found lurking around a variety of developer conferences.

Visual Studio Tools for Apache Cordova Update 5

$
0
0

Welcome to the new year and a new Visual Studio Tools for Apache Cordova (TACO) update! We just released Update 5 of the tools for you—full details are in the release notes—and we’ve created a new developer blog that you can follow to keep up to date with tips, tricks, and articles from our development team.

New in Visual Studio TACO Update 5

In Visual Studio 2015, you should see a prompt to download and install the new Visual Studio TACO Update 5 release.

Visual Studio prompt to install TACO Update 5

The top changes in this release are:

  • CLI interop. If you switch between the command line and Visual Studio, your changes reflected in both development environments.
  • Node 5 / NPM 3 and Cordova 5.4.1 / 6 compatibility. Right now, NPM 3 does not work with Cordova versions 5.3.x and lower. In Update 5, if you are targeting a Cordova version older than 5.4.0 and you have NPM 3 or higher, we will fail your build and show you an error message with suggestions for fixing your build.
  • Over 50 bug fixes. These address issues such as supporting the iOS 6s simulator, various Ripple deployment matters, and support for MySQL.

Read more from our developers, or go to the release notes for Update 5.

Keeping in touch with you!

In addition to building out our tools, we’ve also been working on a few new ways to connect you with members of our team—to help you master the tools and move past issues blocking you from completing your projects.

New developer blog. We’ve just released a new Visual Studio TACO Developer Blog to which we’ll share out regular topics from our engineering team – including tips, tricks, and “behind the scenes” topics.

Visual Studio TACO Developer Blog

Cordova Tools Live Stream. We’re also continuing the Cordova Tools Live stream that we announced last November. In the months ahead, we’ll continue to have regular question and answer sessions with the community. We’ll also be expanding to include a regular set of interviews and topics of interest to Cordova developers at large. Finally, you’ll see us step up the video and audio quality dramatically with the help of our friends at Channel 9.

Cordova Tools Live

Visual Studio TACO Newsletter. In order to keep you updated on all the new samples, tutorials, and guides we are coming out with, we have started a Visual Studio TACO Newsletter with helpful tips on the topics we find you all are asking about. Sign up here and look for the first issue in late January!

 

Lina Zhong

Linda Zhong, Program Manager, Visual Studio Client Tools Team

Linda is new to the Tools for Apache Cordova team, but not new to the trials and tribulations of sad documentation. She spends her time thinking about how to make the VS Cordova user experience really rock!

Jordan Matthiesen

Jordan Matthiesen (@JMatthiesen)
Program Manager, Visual Studio Tools for Apache Cordova

Jordan works at Microsoft on JavaScript tooling for web and mobile application developers. He’s been a developer for over 18 years, and currently focuses on talking to as many awesome mobile developers as possible. When not working on dev tools, you’ll find him enjoying quality time with his wife, 4 kids, 1 dog, 1 cat, and a cup of coffee.


Top News from October-December 2015, Part 1

$
0
0

It’s been a few months since our last roll-up of top developer stories, so I’ll be catching up with the news from last fall in two posts. We’ll start here in Part 1 with Visual Studio, .NET, ASP.NET, languages, and a few other tools for good measure. Part 2 will cover a variety of topics including Connect(); //2015, Windows 10, cross-platform development,. Visual Studio Code, and a number of other goodies. So let’s get started.

Visual Studio Update 1: almost like clockwork, John Montgomery announced the CTP (October), RC (November), and RTM (December) releases of Visual Studio Update 1. Among the complete list of features and changes that you can find on the Update 1 RTM Release Notes, and a few of the top features are as follows:

  • The C# Interactive Window and the command-line C# REPL window. (The Interactive Window is the REPL window inside Visual Studio.) For a quick demonstration, watch Kasey Uhlenhuth’s video on Channel 9 (11m 41s).
  • Edit and Continue support for /BigObj in C++, brings this powerful debugging feature to Windows Store C++ projects.
  • Go To Implementation: right-click on an interface or abstract method definition and navigate to its implementation:

Go To Implementation features in Visual Studio 2015 Update 1

 

  • Pull requests in the Team Explorer window through the Pull Requests hub, which shows your requests and those from others. Visual Studio Update 1 also improves the Create Pull Request experience so you can publish branches and create pull requests in a single action.

Pull requests from Team Explorer Window in Visual Studio 2015 Update 1

 

Profiling, remote Linux debugging, and IntelliTest: there has been some advance in a number of tools with Visual Studio 2015 that are worth calling out separately. First is the ability to profile your CPU in the debugger, as explained by Nikhil Joglekar, that lets you watch the CPU utilization graph to see if there is any CPU-intensive code running as you set breakpoints and step through code. In November, Marc Goodner shared the release of the Visual Studio GDB Debugger extension that enables debugging remote Linux targets including IoT devices. Pretty cool stuff, which even works on a Linux VM running in Azure! You can also read Prakash Patel’s post on Remote Debugging for JavaScript. Another fun extension is the Breakpoint Generator Extension, which automatically scans the source code in the active solution, finds the public methods (which are typical entry points to the program), and puts a breakpoint and a configurable trace message to the beginning of each method. Also very cool! And lastly, perhaps the coolest of all for developers with Visual Studio Enterprise Edition, is IntelliTest for .NET, which, as Pratap Lakshman explains in this post, helps you generate a whole suite of unit tests with a high degree of code coverage at a fraction of cost. You can also see a video demo in IntelliTest on Channel9 (34m 45s). Of course, this means you’ll run low on excuses for not unit-testing your .NET code. J

IntelliTest for .NET

On the .NET front: The .NET Framework 4.6.1 announcement got plenty of attention with a variety of improvements, including some for WPF as explained also by Harikrishna Menon in his separate post. There’s also an interesting post by Omar Khudiera of Pangea Engineering called Why .NET? with some comparisons to Go and Java. Then we have the open-source, cross-platform .NET Core (now officially .NET Core 1.0) that is also gaining momentum, and the Introducing .NET Core video (7m 8s) by Richard Lander gives you the overview. .NET Core is also an integral component of Universal Windows apps in Windows 10, as explained in the short video .NET for UWP: CoreFx (3m 8s) by Lician Wischik. But that’s not all—because .NET Core can run on any platform, it’s also suitable for Linux, which means it can be used in Docker containers as well. Elton Stoneman explains this in Getting Started with .NET and Docker. With Docker, too, Adarsha Datta wrapped up a series on Docker: Containerize your Startup, the earlier parts of which we highlighted last summer.

Introducting .NET Core by Richard Lander

ASP.NET: You may have just read on the ASP.NET blog (or Scott Hanselman’s) that ASP.NET 5 is now officially called ASP.NET Core 1.0 to go along with .NET Core 1.0 and Entity Framework 1.0 (which was Entity Framework 7). The naming change underscores the fact that the former “ASP.NET 5” was not a replacement for ASP.NET 4.6 and that we’re really entering a new space with the “Core” releases—“a fork in the road” as Hanselman describes it. That said, you’ll still find quite a few entirely applicable resources on “ASP.NET 5” including Scott Hunter’s video, Introducing ASP.NET 5 and Web Tooling (14m 51s), Dan Wahlin’s longer discussion in Modern Web Development (48m 8s), and Abhinaba Basu’s post, Publishing an ASP.NET 5 Web Application to IIS locally. And of course, fun things continue to happen in ASP.NET 4.6, such as WebHooks, as Scott Hanselman covers in Introducing ASP.NET WebHooks Receivers – Webhooks made easy. He also has a great post on simulating a low bandwidth connection.

clip_image008

C#, C++, TypeScript, and JavaScript: to wrap up the top news for Part 1, we have some fun items to share where languages are concerned. First, you can get a look ahead to C# 7 with this video by Mads Torgersen (58m 15s). If you’re writing C++, you’ll probably enjoy the session Writing Good C++14 from CppCon2015 (1h 42m) by none other than the master himself, Bjarne Stroustrup! And if you want be on the cutting edge of some C++ developments, check out the C++ Experimental Editor Tools, which you can turn on and off in Visual Studio 2015 as explained by Gabriel Ha. Heading over to the land of JIT, now, Bill Ticehurst has a video on What’s New in TypeScript (12m 7s) and David Catuhe shares two posts on Using JavaScript frameworks from your C#/UWP application and JavaScript goes to Asynchronous City, in the latter of which he shares the developments on promises in ECMAScript 6. Oh, and did you catch the news in December that Microsoft Edge’s “Chakra” JavaScript engine went open source? The repository itself just opened up here in January.

Soma SomasegarFinally, on behalf of everyone who has enjoyed working with and for Soma Somasegar, we wish you a fond farewell as you wrapped up 27 years of service at Microsoft! To enjoy a look back through his career and all the changes that have taken place during that more than a quarter-century, check out Mary Jo Foley’s exit interview with Soma. In one response he says, “I am a strong believer in developer choice and meeting developers where they are. Microsoft has been all about building great tools and platforms and letting developers make the choice of what they want to use and when.” That legacy, I know, pervades the work we do in Microsoft’s Developer Division, and will persist long into the future.
Thank you, Soma!

 

clip_image011

Kraig Brockschmidt, Senior Content Developer, Visual Studio
@kraigbro

Kraig has been around Microsoft since 1988, working in roles that always have to do with helping developers write great software. Currently he’s focused on developing content for cross-platform mobile app development with both Xamarin and Cordova. He writes for MSDN Magazine, is the author of Programming Windows Store Apps with HTML, CSS and JavaScript (two editions) and Inside OLE (two editions, if you remember those) from Microsoft Press, occasionally blogs on kraigbrockschmidt.com, and can be found lurking around a variety of developer conferences.

Top News from October-December 2015, Part 2

$
0
0

In Part 1 of this post I shared news from the fall on Visual Studio, .NET, ASP.NET, and languages. Here I’ll conclude the roll-up with news around Connect(); //2015, cross-platform development,. Visual Studio Code, Windows 10, and a little more.

Connect(); //2015: Our second Connect(); event was, to my mind, even more impressive than the first. I say this not just for the news and announcements, as John Montgomery reviews in his post, but for the way that all the demos tied together into one story that really illustrated the comprehensive platforms and tools that Microsoft is now delivering. Those demos were all built around a full health and technology scenario called HealthClinic.biz, the story of which Erika Ehril Cabral shares in her post from December. If you haven’t read that post yet, don’t deprive yourself any longer, because it also includes specific links to the exact demo segments in the Connect(); //2015 videos! Better still, the whole scenario is on GitHub so you can benefit from the work and also make contributions. And for just a bit of fun, take half a minute (OK, 35 seconds!) to enjoy Scott Guthrie get’s ready for Connect(); //2015.

Scott Guthrie prepares for Connect(); //2015

Mobile and Cross-Platform Tools: work continues at a rapid pace on tools that help you develop mobile apps with Visual Studio. For Android directly, Marian Luparo talks all about Java debugging and language support in Visual Studio, and Mike James (on I Programmer) published a comparison between Visual Studio and Android Studio. The Visual Studio Emulator for Android team keeps delivering improvements too, and you can get the latest from John Kemnetz in his Connect(); //2015 video (5m 55s). Expanding to cross-platform tools for Windows, iOS, and Android, you can get an overview from Amanda Silver (3m 19s) and go into much more depth with Jeremy Foster, Varun Gupta, Ankit Asthana, and Jonathan Carter (54m 38s). In the latter you’ll hear about all the cross-platform tools including the Visual Studio Tools for Apache Cordova, Xamarin, Windows 10 UWP, and cross-platform C++. In this context, also check out Microsoft’s new Code Push service that enables Cordova and React Native developers to deploy mobile app updates directly to user devices, along with James Montemagno’s discussion on Xamarin.Forms 13m 4s) and the new Xamarin 4 release.

Java language support in Visual Studio

Windows 10 for Awesome Hardware: Windows 10 is certainly gaining momentum on a wide variety of systems, and Visual Studio clearly offers great tools for the Universal Windows Platform. What’s most fun to watch, though, is how Windows 10 is reaching onto new devices. Mark DeFalco and Nikola Metulev, for example, made a fun video on HoloLens + Lumia + Surface + Band + Windows 10 (24m 11s) that you can view on Channel 9. With the release of the Microsoft Band 2, there’s also an updated Band SDK that you can learn about from Maria Kang. And if you’re really just getting started, then try starting with Bob Tabor’s training series, Windows 10 development for absolute beginners. With dozens of episodes, you’ll learn everything you need!

Microsoft Band 2

Visual Studio Code: It’s quite enjoyable to see the evolution of this newest member of the Visual Studio family as it reaches many developers on non-Microsoft platforms. Sergiy Baydachnyy has been writing a whole series on Visual Studio Code for Mac developers, covering everything from installation and editor features to working with Git, deploying to Azure, and developing Cordova apps. I myself recently spend some time working exclusively in Visual Studio with Node.js, Express, MongoDB, and client-side AngularJS, and was impressed both by Code’s lightweight speed (it takes only a minute to install!) and its extensibility to support all kinds of different development scenarios. One key thing I learned: whenever you install a new package from npm, go right out and get the IntelliSense definitions via the tsd command. For web development too (and on a Mac), Robert Green shows you all the tricks in Visual Studio Code and Web Development (41m 52s).

Visual Studio Code on Mac OS X

 

U-SQL: The world of SQL is not necessarily where you expect to see new developments, but the introduction of U-SQL as a Big Data query language has attracted quite a bit of attention. Michael Rys first announced the language and its rationales in Introducing U-SQL – A Language that makes Big Data Processing Easy, and followed up with Writing and Using Custom Code in U-SQL. All this goes along with the public preview of the Azure Data Lake service, which is definitely work checking out if Big Data is on your radar.

And finally, for a bit of fun, developers of all sorts will appreciate Peter Wayner’s 9 bad programming habits we secretly love. I especially enjoyed the comments on goto because I did quite a bit of assembly programming early in my career where jump and branch instructions are just a way of life when you don’t have any higher-level concepts to work with. I imagine that some IoT developers working in assembly are thinking the same thing!

 

clip_image011[5]

Kraig Brockschmidt, Senior Content Developer, Visual Studio
@kraigbro

Kraig has been around Microsoft since 1988, working in roles that always have to do with helping developers write great software. Currently he’s focused on developing content for cross-platform mobile app development with both Xamarin and Cordova. He writes for MSDN Magazine, is the author of Programming Windows Store Apps with HTML, CSS and JavaScript (two editions) and Inside OLE (two editions, if you remember those) from Microsoft Press, occasionally blogs on kraigbrockschmidt.com, and can be found lurking around a variety of developer conferences.

Apache Cordova development lands on Visual Studio Code

$
0
0

Thousands of developers already use Visual Studio’s Tools for Apache Cordova—affectionately abbreviated as “TACO”—to build mobile apps for iOS, Android and Windows using a shared JavaScript codebase. Within the IDE, TACO provides everything you need to install and configure the native SDKs, preview your app, debug on emulators and devices, and even manage continuous integration/deployment via Visual Studio Team Services.

Today, we are pleased to announce new ways to build, debug and preview Cordova apps using your favorite light-weight text editor (it is your favorite, right?): VS Code and the Cordova Tools extension.

With this extension, you can debug hybrid apps, find Cordova-specific commands in the Command Palette, and use IntelliSense to browse objects, functions, and parameters. You can use it with both “stock” versions of the Apache Cordova framework and downstream frameworks like Ionic, Onsen, PhoneGap and SAP Fiori Mobile Client. Because they all use the same Cordova build systems and core runtime, the TACO extension is adaptable to the JavaScript framework of your choice.

In fact, you can even use Visual Studio Code on a project created with the full Visual Studio IDE. For example, imagine creating a Cordova project using Ionic templates with Visual Studio on a Windows machine, then opening it on an OS X or Linux machine using Visual Studio Code—making some edits—then continuing your work in the Visual Studio IDE. No matter which editor you choose, you get the full benefit of debugging, IntelliSense, and language support. How cool is that?

Debugging a Cordova app in Visual Studio Code

Visual Studio Code + Cordova Tools currently support debugging apps on emulators, simulators, and tethered devices for Android and iOS. If you ask for it (email or tweet us), Windows support will follow not too far behind. You can also attach the debugger to an app that is already running on a device; the debugger simply uses the application ID to locate the running instance.

How do I get it?

If you haven’t already, download and install Visual Studio Code for Mac, Windows or Linux from http://code.visualstudio.com. It’s under 50MB and on a decent network connection you’ll have it installed in under 2 minutes. Once that’s done, install the Cordova Tools extension directly from within the code editor. Simply invoke the Command Palette (Cmd+P on Mac, Ctrl+P on Windows), type “>ext install cordova”, and hit Enter.

Installing the Cordova Tools extension in Visual Studio Code

You guessed it…open source!

You can, of course, contribute to improving the extension further. The Cordova Tools extension is open source, so if you run into any issues or have suggestions for new features, please open an issue or better yet, make the change and send us a pull request.

And last but not the least, we have also made some improvements in our command line tools and extensions for continuous integration optimizing your inner and outer dev loops!

Send us your feedback

We invite you all to join in our journey to grow an active community of Cordova developers to build amazing apps using TACO. Tell us what you’d like to see, and whether you are interested in testing pre-release versions of TACO. You can do this by joining our insiders program, posting issues on stack overflow, or pinging me directly via e-mail at rsalva (at) microsoft.com. We look forward to hearing from you!

 

Ryan Salva

Ryan J. Salva, Principal Program Manager, Visual Studio Client Tools team
Twitter: @ryanjsalva

Ryan is a Principal Program Manager working in the Visual Studio Client Tools team where he looks after HTML, CSS and JavaScript development. He comes from a 15-year career in web standards development & advocacy as an entrepreneur, developer, and graphic designer. Today, he focuses primarily on mobile app development using web technologies and Apache Cordova.

Connect(“demos”); // 2015: HealthClinic.biz

$
0
0

image

During Connect(); //2015 we showcased many technologies available to you as a developer across Azure, Office, Windows, Visual Studio and Visual Studio Team Services. We’ve also heard from you that you love to have real-world applications through which you can directly experience what’s possible using those technologies. This year, then, we built out a full health and technology scenario for our Connect(); //2015 demos and are delighted to share all the source code with you:

image

HealthClinic.biz is a fictitious regular doctor practice specialized in offering healthcare preventive care. This clinic is using different Microsoft and multi-channel apps built with Visual Studio 2015 to grow their business and modernize the customer experience. They also innovate and offer multiple apps and services—including websites, mobile apps, and wearable apps—to empower their patient’s well-being with easy access to manage their healthcare data and stay healthy.

How we built the scenario

We built eight different demo projects in a couple of months using Visual Studio 2015 and Agile methodologies. We used Visual Studio Team Services to host our code repository and to manage our backlog, daily builds, and DevOps cycle across a number of different teams at Microsoft. And all the data, services, and notifications that bring the experiences and devices together are centralized in a variety of Azure services. Here’s how all that is structured:

Structure of HealthClinic.biz

Connect (“with your health”); Demo apps

The core apps in HealthClinic.biz are a public website, a private website, a WPF application for receptionists, a Universal Windows Platform app for patients, mobile apps for patients and doctors, wearable apps, and more! The following sections give a brief summary of each, which you can see in action during the Connect(); //2015 keynotes.

Public and Private Websites

The clinic has a public-facing or marketing site that provides info on the services and apps that the clinic offers. The clinic is also an enterprise and needs to manage doctors and patients in its database. The clinic thus has a private website used for patient/doctor data management and a dashboard to understand visit trends.

Public website

Public website for HealthClinic.biz

 

Private website

Private website for HealthClinic.biz

 

We built both websites using Visual Studio 2015 + ASP.NET 5.0 RC + Azure, with Glimpse and App Insights for monitoring and gathering telemetry.

You can see these apps in action @ Scott Hanselman’s keynote starting at 2:11.

Universal Windows Platform and WPF apps

For receptionists, we built a WPF app that lets them view the information they need. Similarly, we build a Universal Windows Platform app for patients. Both apps use a common Portable Class Library that results in approximately 80% shared client logic code between the apps. You can see more during Kevin Gallo’s demo starting at 1:07:50.

WPF receptionist app

WPF receptionist app for HealthClinic.biz

 

UWP patient app

UWP patient app for HealthClinic.biz

 

Cross-platform mobile apps, and wearables

For patients, we built a cross-platform mobile app using Xamarin so we could deliver a native look and feel and great performance on every device across iOS, Android, and Windows.

We built another app for doctors of the clinic using web technologies and the Visual Studio Tools for Apache Cordova. This allows 100% code reuse across devices, with Cordova plugins providing access to native device capabilities not available in a browser.

Patient mobile app (Xamarin)

Patient mobile app for HealtClinic.biz

 

Doctor mobile app (Apache Cordova)

Doctor mobile app for HealthClinic.biz

 

When patients want to schedule an appointment with their favorite doctor, they need to know when the doctor is available. These apps let patients create appointments in both the doctor’s Office 365 calendar and in their own Outlook.com calendar using same API, the Microsoft Graph API.

Of course, mobility is not only about smartphones and tablets. Wouldn’t it also be great if the doctors of this clinic could provide continuous service? Using Visual Studio 2015, we built an app that provides medication reminders for the Apple Watch and Microsoft Band 2 so patients can have assisted care throughout the day.

Apple Watch and Microsoft Band

 

Watch Amanda Silver’s keynote talk and demo starting at 1:16:55 where she shows the latest on mobile development, including native cross platform apps (Xamarin), hybrid cross-platform apps (Cordova), and wearables.

Even more apps

During their segment, Brian Harry and Donovan Brown demonstrated (starting at 16:30) how Visual Studio Team Services plus different extensions work together to create an awesome DevOps experience for devices and services. And for the grand finale, Scott Hanselman showed a smart end-to-end diabetes monitoring scenario. He used multiple cloud technologies including health data from Microsoft Health, his own glucose data in the cloud, Azure Machine Learning experiment data, and the Microsoft Graph API to get insights from his own personal health data, such as determining the most stressful times in his calendar. Let’s just say the common thread had something to do with a man in a red shirt.

Scott Hanselman's demonstration of personal health data using Azure

 

Download the code and contribute!

By now we hope you’re ready to get into the HealthClinic.biz code yourself, which you can download from GitHub. And we certainly invite you to help build out this scenario further to help many other developers realize solutions that can be built with the latest developer technologies to serve the many needs in our world today.

Download the code:  HealthClinic.biz on GitHub

Enjoy!

image

Erika Ehrli Cabral, Senior Product Marketing Manager, Developer Tools

@erikaehrli1

Erika has been at Microsoft for over 11 years, working first in Microsoft Consulting and enjoying later on different roles where she created content and code samples for developers. In her current role she is now focused on executive keynote demos and Visual Studio and Azure product marketing.

The .NET Journey: Recapping the last year

$
0
0

Having just completed Connect(); // 2015, we thought to take a moment to review everything that’s happened with .NET over the last year, between last year’s and this year’s Connect();. And what a year it’s been! We’ve seen significant developments in the .NET Framework, including the release of new versions, and also the release of two new technologies, .NET Native and .NET Core, both of which will change the ways in which the .NET Framework is used and the platforms on which it is supported.

The .NET Framework 4.6

The .NET Framework version 4.6 was released in July with Visual Studio 2015 and is automatically installed on all Windows 10 systems. As the latest release of a mature product known for its robustness and ease of development, .NET Framework 4.6 offers improved app performance and a variety of individual feature enhancements:

  • A new version of the 64-bit JIT (Just-in-Time) compiler significantly enhances performance and supports SIMD hardware acceleration. A compiled app that targets x64 or anyCPU automatically takes advantage of the new JIT compiler when it runs on a 64-bit operating system.
  • Improved loading of assemblies decrease virtual memory.
  • Greater control over the garbage collector lets you disallow garbage collection during the execution of a critical path by calling GC.TryStartNoGCRegion and EndNoGCRegion. You can also use an overload of the GC.Collect method to control whether both the small object heap and the large object heap are swept and compacted or swept only.
  • The addition of SIMD-enabled vector types, such as Vector2, Vector3, and Vector4, Matrix3x2, and Matrix4x4, to the System.Numerics namespace.
  • Support for the Windows CNG cryptography APIs. The .NET Framework 4.6 adds the RSACng class to provide a CNG implementation of the RSA algorithm, a set of extension methods for X509 certificates, and enhancements to the RSA API so that common operations no longer require casting or type conversion.
  • Methods to convert the .NET Framework’s DateTimeOffset values to Unix time.
  • An AppContext class, which allows library developers to provide a uniform way for users of their application to opt out of new features.
  • Task-based asynchronous pattern (TAP) enhancements, including convenience methods to return completed tasks in a particular state (such as Task.FromCanceled) and a new class, AsyncLocal<T>, that allows you to store ambient data that is local to a particular asynchronous control flow. In addition, for apps that target the .NET Framework 4.6, tasks inherit the culture of the calling thread.
  • Improved rendering in Windows Presentation Foundation (WPF) and Windows Forms. WPF also has improved support for touch.
  • In Windows Communications Foundation (WCF), support for TLS 1.1 and TLS 1.2 in addition to SSL 3.0 and TLS 1.0. You can also select the protocol to use, or disable less secure protocols, programmatically, and you can send messages using different HTTP connections.

There are also enhancements in networking, Windows Workflow Foundation (WWF), transaction processing, and code page encoding. For a complete list of new features and additional detail, see What’s New in the .NET Framework.

The .NET Framework 4.6.1

The .NET Framework version 4.6.1 was released on November 30 and is automatically installed with the Windows 10 November Update. The .NET Framework 4.6.1 features performance and reliability improvements, as well as a handful of new features. As part of the ongoing work to modernize the cryptography API, the .NET Framework’s cryptography API now includes support for Elliptic Curve Digital Signature Algorithm (ECDSA) X509 certificates. In addition, Windows Presentation Foundation features spell-checking improvements and additional support for per-user custom dictionaries, while Windows Workflow Foundation now supports a distributed transaction manager other than MSDTC.

In-place and side-by-side upgrades

The .NET Framework 4.6 or 4.6.1 is an in-place upgrades for the .NET Framework versions 4.0, 4.5, 4.5.1, and 4.5.2. In other words, if any of those other four versions are already installed on a system, installing the .NET Framework 4.6 or 4.6.1 replaces them.

The .NET Framework 4.6 or 4.6.1 is a side-by-side upgrade for systems with any versions earlier than the .NET Framework 4 (the .NET Framework versions 1.1, 2.0, or 3.5); in other words, the .NET Framework does not replace these versions but instead is installed separately. Applications that target these older versions of the .NET Framework run on the older version if it is present. If the original targeted version of the .NET Framework is not present, they can instead run on the .NET Framework 4.6 if the following entry is made in the app’s configuration file:

<configuration>

  <startup>

    <supportedRuntimeversion=v4.0 />

  </startup>

</configuration>

Application compatibility with .NET Framework 4.6 and 4.6.1

Will an application developed for an earlier version of the .NET Framework run under the .NET Framework 4.6 or 4.6.1? The .NET Framework maintains an extremely high level of backward compatibility from one version to another. Almost all applications that target the .NET Framework 4 and its point releases will run without modification on the .NET Framework 4.6 or 4.6.1. For a list of changes that may require recompilation, along with an assessment of their significance and possible workarounds, see Runtime Changes in the .NET Framework 4.6 and Runtime Changes in the .NET Framework 4.6.1. Some changes only affect apps that explicitly target the .NET Framework 4.6 or 4.6.1, but provide a different behavior for apps that target a previous version; for a list of these, see Retargeting Changes in the .NET Framework 4.6 and Retargeting Changes in the .NET Framework 4.6.1.

.NET Native

.NET Native is a compilation and deployment technology for Universal Windows Platform (UWP) apps written in C# and Visual Basic. It uses and optimized implementation of .NET Core (discussed in the next section) and compiles apps to native code. In other words, it compiles an app running on an ARM system to the ARM instruction set, and it compiles an app running on an x64 system to the x64 instruction set. This differs from most .NET Framework applications, which are compiled to intermediate language (IL) before they are deployed, and then are compiled to native code at runtime by the Just-In-Time (JIT) compiler.

Selecting the .NET Native options

.NET Native produces small, compact binaries that load and start up quickly. It statically links only those code elements from the .NET Framework Class Library and any other libraries you may use. Code paths that are not executed by your application are not linked into the binary. Along with your application code, .NET Native produces a small app-local runtime whose primary responsibility is memory management and garbage collection. For more information on .NET Native’s compilation technology, see .NET Native and Compilation.

Normally, the .NET Framework Class Library includes rich metadata about each assembly, type, and member. When compiling apps to native code, however, .NET Native includes only the metadata that an app actually needs at runtime. For some reflection and serialization scenarios, the .NET Native tool chain may be unable to detect that it needs specific metadata. You can identify these scenarios and ensure that the .NET Native tool chain includes all the necessary metadata at runtime by testing the release version of your app and defining the required metadata in a runtime directives file. In addition, two troubleshooters that help supply the runtime directives needed to reflect on or serialize types and type members are available.

By default, the release builds of all UWP apps written in C# or Visual Basic are compiled to native code with the .NET Native tool chain. For faster compilation and ease of debugging, however, debug builds are not compiled with the .NET Native tool chain. This makes it important to thoroughly test the release builds of your app on each of its target platforms.

For more information about creating UWP apps that are compiled to native code, see Getting Started with .NET Native.

.NET Core

.NET Core is a modular, cross-platform, open source implementation of the .NET Framework that will run on Windows devices, as well as on Linux and Mac OSX. Unlike the .NET Framework, .NET Core consists of a set of runtime, library, and compiler components that can be used in various configurations, depending on the needs of your application.

To get a better sense of what .NET Core is, let’s compare it to the.NET Framework 4.6:

.NET Framework

.NET Core

A sizable runtime, the CLR, that provides memory management and a host of other application services.

CoreCLR, lightweight runtime that provides basic services, particularly automatic memory management and garbage collection, to your app, along with a basic type library.

The .NET Framework Class Library, a large, monolithic library with thousands of classes and many thousands of members. Whether or not your application uses individual types and their members, they are always present and accessible.

CoreFX, a set of individual modular assemblies that you can add to your application as needed. Unlike the .NET Framework 4.5, where the entire .NET Framework Class Library is present, you can select only the assemblies that you need. That the assemblies are local to your application solves versioning problems and reduces the overall size of your applications. For example, if you are developing a vector-based application, you can download the System.Numerics.Vectors package without the overhead of a large class library.

Suitable for developing traditional Windows desktop applications.

Suitable for a full range of modern applications that operate on small devices with constrained memory and storage.

Aside from a basic setup procedure, each CoreFx module is independently downloadable as a NuGet package from the CoreCLR GitHub repo.

For more information on .NET Core, see Introducing .NET Core. For the basic .NET Core documentation set, see .NET Core: A General Purpose Managed Framework.

We hope you’ve enjoyed this recap of everything that’s happened in .NET over the last year. As always, we invite your feedback, suggestions, thoughts, and ideas on UserVoice, through the in-product feedback UI, or file a bug through the Visual Studio Connect site

Ron Petrusha

Ron Petrusha is a programming writer on the .NET Framework team. He is also the author or co-author of a number of computer books, including Inside the Windows 95 Registry, VBScript in a Nutshell, and Visual Basic 2005: The Complete Reference.

Viewing all 1076 articles
Browse latest View live