Notes From Build 2017

I attended Microsoft Build conference 2017 last week.  I wanted to quickly document my notes.  Some come from sessions, some from key notes.  Enjoy.

Key notes

The keynote on day one incorporated familiar and new themes. We heard that Microsoft is striving to be a leader in cloud first, mobile first world, which was a familiar concept. They are obviously making large strides, based on recent revenue figures for all the cloud providers. Microsoft is way behind Amazon, but in front of Google. The cloud based revenue from Microsoft is in the tens of billions.

Satya talked about an expansion into other aspect. There is a push under way to move some of the intelligent cloud features to “intelligent edge”, i.e. smart devices. Related to that was ability to run the same code that is developed for the cloud on connected smart devices, running Windows IoT Core or even other operating systems, such as Linux. Related to intelligent cloud concepts were AI or artificial intelligence. This set of technologies has many capabilities already, such as image recognition, natural speech recognition, machine learning, etc… AI is meant to make humans’ lives better. One way touted would be to connect multiple devices for people into a single smart entity, where people can start a task on one device and continue on another.

Obviously, tools are necessary to build such software. Part of the keynote was dedicated to advancements in tooling, such as support for Azure functions in Visual Studio, enhancement to VS itself, and ASP.NET Core. Visual Studio for Mac is now generally available, out of preview stage, including support for Xamarin and .NET Core projects. It includes a set of features that enables good interaction with Azure, including publishing from within VS for Mac. VS 2017 Update 3 preview was released with support for .NET Core 2.0 based on .NET Standard 2.0 and with ASP.NET Core 2.0 support included in the corresponding SDK. For now those projects cannot be run on full .NET framework, which caused a bit of ruckus online. However, Microsoft stated in a blog post later that this will change in one of the subsequent releases of .NET Core 2.0. There were big additions to .NET standard, hence to .NET Core since 1.1. Over 20,000 APIs were added to the surface of .NET Core since 1.1 was released. It seems to be quickly reaching maturity, whereby many web apps can be migrated to the .NET core from full .NET. This will enable developers to run those apps on Linux or even in Linux Docker containers. This of course in addition to be able to run those apps in IIS on Windows Servers and in Windows Containers on Windows Server 2016. There are obviously still APIs that are missing, such as System.Drawing and System.DirectoryServices. However, there are already .NET Core drawing libraries if this is the only thing that is holding you back. My guess is that before too long both will make their way to .NET Core. New DotNet Core Guidance web site is now available here http://dot.net/architecture. It will replace now dismantled Patterns and Practices group.

A big enhancement occurred in Xamarin toolset, making it even easier to build cross platform applications with a single code base. There was a demo of Xamarin Live Player app which allows developers to code in Windows and connect an iPhone via this app and live debug software, including live reload of changes made in Visual Studio. Live Edit and Continue is supported as well, both for XAML in Xamarin Forms and code. There was an announcement that work on XAML standard 1.0 is under way, designed to unify all the XAML dialects long term across UWP, Xamarin Forms and, maybe/hopefully, WPF to some extent.

There were Azure announcements made, including live shell inside Azure portal. There is now also a mobile app that let developers interact with Azure portal. It has the same shell in it as well!!!. There was an announcement for new Cosmos DB, Azure document database. MySql and Postgres are available as a service, not inside VM on Azure now.

Second keynote was about Windows. Over 1/2 billion devices now run Windows 10. By far, it has been the most successful Windows version. There was a talk about Fall Creators Update release of Windows 10, enabling features such as timeline in Windows, containing all user’s actions and activities across devices. There was also a demo for the cross device clipboard. We also saw very cool and extremely advanced multi-device video creation software, replacement for movie maker. It contained image recognition, AI that follows people and can remix videos with music. OneDrive on Demand will connect files on all devices across platforms, making it transparent that files may not event exist on a device, being downloaded on demand. Many features utilize Microsoft Graph, technology that gathers all the information about a user in the cloud. App developers can tap into the graph as well. SDK for iOS is live. Part of the demo looked a bit scary to me from privacy perspective, but technologically looked awesome. There was also demo of an improved ink/pen support.

There was a short talk about user experience, highlighting a new design language from Microsoft, called Fluent Design Framework. It seems to be primarily focused on Windows store apps. Very little substance was present, but key principles are light, depth, motion, material and scale. Light is supposed to attract users’ attention to something, Depth should provide perspective so we can tell which elements of an app are closer that others. Motion should enable users to follow actions on a screen as they occur. Material will enable them to relate software to physical world. Scale is all about making the software three dimensional, like the world. I imagine this framework will compete with Google’s material design framework. These are all my own thoughts, in addition to scant details present in the talk. However, we need to wait and see what documentation Microsoft will provide.

Then there were demos related to mixed reality, new hand held controllers for HoloLens where revealed. An announcement was made that partners will be shipping VR headsets this holiday season that can run on Windows 10. There price would start at $400, for Acer device. One can imaging that before too long VR sets, supported in various software and specifically games will be commonplace in households before too long.

There as a demo related to new Narrator in Windows that developers can use for testing. It darkens the screen, highlighting only active controls. I was glad to see that accessibility does not loose its focus in MS world.

You can download Asp.NET Core 2 preview 1 at https://www.microsoft.com/net/core/preview#windowscmd

You will also need VS 2017 preview https://www.visualstudio.com/vs/preview/

 

20170511_024932038_iOS

 

20170511_024606877_iOS

 

20170511_022448274_iOS

 

clip_image004

 

Xamarin Forms

 

You can look at the roadmap yourself: https://aka.ms/xfroadmap

There is a previewe tool available in Visual studio, allowing developers to see what the live app will look like without running it. I already mentioned Live Player app, and it is indeed a very impressive feature. You can download version 2.3.5-preview 3 today. The features available on Windows and Mac.

In the next major release: 3.0 the following features are being worked on

  • Performance improvements
  • Support for web like “flex” layout
  • Forms embedding, allowing developers to start with Xamarin Forms, then switch to Xamarin native or even iOS native, and re-use the code they wrote for Forms.
  • Support for WPF apps

 

20170511_174710204_iOS

 

20170511_182957668_iOS

 

EF 2.0

A number of features is being worked on for Entity Framework 2.0

  • Global query filters, useful for multi-tenant apps for example
  • EF.Property method to allow to drop certain public properties from the model, but still persist them to DB
  • DbContext pooling to improve performance
  • EF Core already supports multiple platforms, hence you can use SQLite for example while you are developing for a raspberry pie running IoT Windows Core. or Linux in general.
  • Compiled queries
  • EF Functions that help you test in memory even though you write engine specific code, such as LIKE statement
  • Owned entities, aka complex types. This includes support for nested owned types and mix-match between owned types and entities

Post 2.0 we saw improvements to Seed data approach, making them part of migrations and scaffolding of those

EF Core Demos:

https://github.com/rowanmiller/demo-efcore

https://github.com/rowanmiller/unicornlauncher

 

C# Futures and 7.0

I attended this talk and wanted to summarize quickly what was shown.

 

Debugging Tips

Not sure how much I knew existed in VS 2017, so here is a stream of consciousness

  • Locals window captures return values from functions that just executed within the context of the where your debugger is paused.
  • In Watch windows you can type $returnValueX, where x is a number to also observe return values from functions just called within the scope of where you are stepping through
  • Step into specific – if multiple functions are called on one line, you can pick the one to step into
  • Run to cursor is available directly in the editor as a “hint” glyph. Just click on it to run to that spot
  • Call Stack window also has run to cursor functioanlity
  • F10 can start your program by stepping into “Main
  • Debugger.Break() will stop the software and pull up attached debugger. Protect this code by Debugger.IsAttached
  • There are multiple Debugger visualizers, include JSON and HTML in addition to plain text visualizer
  • You can control the summary of any object as it appears in debugger by using DebuggerDisplay attribute of just overwriting ToString(). Useful when watch windows has an array or a list of things
  • You can pin data tip (what you see when your mouse is over a variable) in the editor
  • You can use Make Object Id feature to create an id for any object and have it persist in debug session, whereby you can add it to Watch windows with that ID. Delete when you are done for efficiency
  • Better null reference error support by using type such as string? Instead of just string
  • “Ctrl + ,” pulls up Go To All windows, allowing for easy project navigation
  • You can have conditional breakpoints and attach actions to them, such as output something to debug window. You can also filter based on pseud variables such as thread id. You can also create filter based on Hit Count – how many times your breakpoint is hit
  • You can use performance tips / glyphs to pinpoint bottlenecks
  • In diagnostic tools window you can take snapshots for memory and compare memory usage between snapshots
  • You can activate historical debugging – this will allow you to examine IntelliTrace captured data, including variable values
  • Exception Helper window allows you to easily see inner exceptions. It also tell you exactly what was null when null reference exception is thrown
  • In exception configuration windows you can setup additional condition for exceptions globally, such as assembly names
  • Parallel threads windows supports threads and tasks
  • Parallel watch window allows you to click and show what code a thread is running
  • You can freeze and thaw threads, pausing one in Threads windows or right – click menu
  • If you have multiple threads breaking at the same breakpoint, just remove the breakpoint to step through the code only in the current thread
  • Future: step back in debugger, unwinding previously executed code
  • Future: you will have set next statement glyphs
  • Debugger Team Blog: https://aka.ms/DiagnosticsBlog
  • Samples from the demo: https://aka.ms/vsdiagsamples

 

Web Development

It was a bit hard to say which features are native to VS and which are plugins

  • You can leverage TypeScript 2.3 to add features to JS code. Just add checkJS: true to tsconfig.json file and you can use jsdoc comments to check for types correctness. This also enables better intellisense.
  • Client side debugging in VS when the app is running in Chrome
  • Many plugin where demoed adding features such as
    • Live reload of the code
    • ESLint support
    • Accessibility checker
  • toolSetting.json to control files layout inside a project
  • Library.json – new way to just pull individual script libraries into your project instead of using npm or yarn
  • VS 2017 supports ASP.NET Core project type that does not really run any .NET Core code. It is a staic HTML, JS, CSS project with Core tooling support only. This allows for live reload, live bundling, etc..
  • You can find the extensions at https://tinyurl.com/ExtensionList
  • Web team blog is at https://aka.ms/WebDevBlog
  • Web Essentials for VS 2017 is available

 

Pro Tip

In Windows Explorer address bar type “cmd” to open command prompt in the current folder.

Type “powershell” to open PowerShell prompt in the current folder.

Leave a Reply

Your email address will not be published. Required fields are marked *