Show link: .NET Rocks! 1376 (Connect Debrief with Scott Hunter)
Guest: Scott Hunter
Show Notes
- Many of the topics from this show were discussed at the Connect 2016 conference. See also: .NET Core Roadmap
- What’s new in .NET Core 1.1?
- .NET Core shipped in June 2016. The goal is to revise .NET Core faster (i.e., every 6 months for point releases, then every 2 months for bug fixes) than the entire .NET framework, which is part of the Windows operating system (i.e., updates 1-2 times per year).
- Version 1.1 is not as full-featured as 1.2, and the tooling support is being addressed.
- ASP.NET Core
- There are modules (e.g., URL rewriting module) that run in IIS; Microsoft is making versions of them that run in ASP.NET Core.
- You can have your apps start faster by using view compilation.
- In App Service, logs can go to the disk or other forms of storage. There’s now an App Service log provider that when enabled, makes ASP.NET aware of what settings you have so that logs get sent to the right place based on Azure portal settings.
- Response caching is being introduced, which sends the right headers on pages to tell a remote browser or proxy server what to cache locally.
- Database-related changes
- Entity Framework Core (EF Core) has the same features as Entity Framework 6, such as connection retries without having to write any additional code.
- SQL Server 2016
- All enterprise SKU features are moving down to all editions.
- You can designate tables to run in memory for faster performance. In EF Core you put an attribute on the table, run a migration on the database, and then just rerun the app.
- You can designate single columns to run in memory.
- There are audit tables (e.g., which user added a row) for tables, so you no longer have to write stored procedures to manage this yourself. Simply add attributes on the table, and you get an extra accessor on the model to query either the table or the audit data.
- Docker
- At Microsoft Ignite 2016, Docker containers for Windows was demonstrated.
- You can develop locally with Docker for Windows, and then publish to Windows Server 2016.
- Microsoft has had Docker for ASP.NET Core for Linux for a while. At Connect 2016, they announced App Service on Linux. In Azure you can run .NET, Node, Java, or PHP apps on a Windows host. Some Node modules don’t work on Windows, so having App Service support on Linux solves this.
- App Service on Linux is implemented via a container. You can use the built-in containers, or you can bring your own. You get the benefits of PaaS and bring your own container to have the platform be whatever you want. From the .NET perspective, you can build a .NET app in Visual Studio, then right-click to turn it into a container that can be published to App Service.
- Creating a service takes about 15-20 seconds.
- You might use App Service over using a virtual machine because you get more control. In App Service you get backups, deployment slots, and you don’t have to own the operating system. There are reasons for both, but App Service excels at containers.
- App Service Containers vs Azure Container Service: App Service is more of a single container mechanism; it doesn’t deal with dependent containers. Azure Container Service deals with multiple dependent containers.
- There’s now an Azure Docker registry. (Docker Hub is what served this role before.) The Azure Docker registry can be private to your organization. Integration is simple as well: Convert your ASP.NET Core app into containerized application, publish it to the Azure Docker registry, and then App Service or Azure Container Services then sees the change to pull in.
- App Service is aimed at getting people started with containers, or for those with smaller apps. As your apps get bigger and more complicated, you can migrate to Azure Container Service.
- There’s a new tooling workflow in Visual Studio (or for the command line) to set up a pipeline for containers. Provide the location of your source code repository and what registry to use, and from there the tool sets everything up. In Visual Studio Team Systems when you commit to the source code, the container gets built in the cloud, tests on that container are run in the cloud, and if those tests pass, then the container is uploaded to a registry of your choice.
- The goal is to make development as easy as possible, and with Azure, make it as easy as possible to host.
- .NET Standard
- Microsoft looked at all the .NET platforms. As a developer, it’s a challenge to write code that works on all platforms (i.e., fragmented APIs).
- Portable class libraries (PCLs) were a stop-gap; as you select more frameworks you want your library to run on, you are able to use less of .NET.
- Microsoft took all the parts of .NET that aren’t an app model (i.e., WinForms, WCF, ASP.NET, WPF, Xamarin) and said that those should be consistent across all of .NET. The result is .NET Standard.
- If you build a library that targets .NET Standard, then it should run in any app model.
- The goal is to make .NET developers successful in sharing code across any .NET app — Xamarin, .NET Core, etc.
- With .NET Core, it’s a subset of .NET. As people port their apps to .NET Core, they may find functionality that’s missing. In early 2017, .NET Core will support .NET Standard 2.0; this will fill in the gaps — e.g., XML, serialization, networking, and I/O.
- The three pillars of .NET — .NET Core, .NET Standard, and Xamarin — will have massive compatibility between them.
- When .NET Core development started, it was focused around ASP.NET 5. It was designed as a specific one-off to make ASP.NET 5 run everywhere and very fast. .NET Standard was born out of bringing in Xamarin.
- Project tooling
- Microsoft has been using a new build system: Project.json. The goal was to build cross-platform ASP.NET applications on a Mac using a JSON-based project file.
- To unify platforms, Microsoft would need to either make everything in .NET be Project.json-based, or take all the Project.json elements and make it work with MSBuild. It was easier to stick with MSBuild; however, Microsoft is taking the best things of Project.json and moving them into MSBuild (e.g., building wildcard support in .csproj files, such as “*.cs”).
- When referencing projects, there will no longer be GUID references.
- The preview versions of the tooling can be found in Visual Studio 2015 Preview.
- If you open an existing .NET Core application, it will be converted to a .csproj. There are also command-line tools to add and list project references. Once the migration from Project.json to MSBuild is done, Microsoft will call .NET Core a true “1.0”.
- ASP.NET Core performance
- ASP.NET Core is now live in the Tech Empower benchmark, ranking in the top 10, and ahead of Node, Go, and Servlet.
- The teams at Microsoft are hard at work at adding language features to C# and adding new buffering modules to use in .NET to increase performance.
- Part of the team that builds Orchard CMS ported the project to .NET Core and found it was ten times faster than System.Web. That means if you take your existing app and move it to .NET Core, you should see an improvement.
- What’s next for you?
- Continuing to work on .csproj tooling
- Implementing .NET Standard 2.0
- Working on making ASP.NET the best platform for building container/microservice apps. For example, introducing heartbeats to see if an app is running, determining if you need a full framework like MVC or WebAPI to build REST APIs or whether you can go lighter, and finding a way to discover other containers.
- Adding high-DPI support for WinForms to make those applications look better on modern displays
- Project Centennial lets you take WinForms and WPF apps and run them as Windows Store apps. This is useful for getting applications (and updates to them) onto multiple desktops via the Windows Store; even more so because enterprises can have private stores.
- In the Internet of things (IoT) area, Microsoft is working on getting .NET Core into devices. Samsung is building the Tizen platform — used by TVs, wearables, and low-end Android phones — so that you can program devices using .NET. Samsung has ported .NET Core to work on ARM 32 and 64, and has also ported Xamarin.Forms to run on the Tizen stack.
Better Know a Framework
SourceTree — a free visual Git and Mercurial client for Mac and Windows.
Listener E-mail
From show #1291 (Talking Core with Scott Hunter); the listener commented about the Azure billing site being slow, and that you have to log in to get your Azure invoice (instead of getting it e-mailed to you). Maybe the Microsoft internal people have never used the billing site, so maybe it needs some dogfooding.
Technology Giveaway Ideas
- A fitness tracker to measure how well you sleep, especially the type that goes underneath the mattress (e.g., Withings Aura and Eight)
- Tesla Autopilot; this may not be available in some areas because of regulations for self-driving cars