New Beta 9.0 of C#/XAML for HTML5 Available! Here are the Top 7 New Features

July 25, 2016 — The new beta 9.0 version of C#/XAML for HTML5 is available! For those who do not know the product, it is a free Visual Studio extension that enables developers to create HTML5 apps using only C# and XAML with Visual Studio.
The Top 7 New Features are:

1. Brand New Simulator! (resizable “Desktop Browser” mode, remember settings, etc.)

2. XAML Live Inspector – it lets you inspect the visual tree at runtime and view/change UI element properties on the fly!

3. Up to 20x Faster Compilation!
This is made possible by having the JS/HTML compilation handled by the Simulator rather than MSBuild, so you can start testing your app while the compiler keeps running in the background! (an option will be added in the future to switch between the new style and the old one)
4. JSON Serializer/Deserializer extension (download)
5. DoubleAnimation and ColorAnimation – Powered by the Velocity.js, animations in XAML are now very fluid! Check out the updated Showcase app (File => New Project => C#/XAML for HTML5 => Showcase)

6. LinearGradientBrush7. Over 40+ other new features and bug fixes, including Chrome for Android support, StopWatch, StrokeDashArray, UpdateSourceTrigger, Easing Functions, Storyboard.Begin(), MessageBoxButton, System.Reflection improvements, non-ASCII characters support in WCF/XmlSerializer strings, and a lot more!


Full Change Log (since Beta 8.0):

  • Brand new Simulator! (read new features below)
  • Runtime Visual Tree Inspector! (inspired by the amazing work the XAML Spy team) It lets you navigate the UI elements at runtime and even change their properties on the fly!
  • Much, much faster compilation! (up to 20X faster) The simulator will appear after a few seconds. The generation of JS and HTML files will continue in the background.
  • Simulator feature: Ability to choose “Desktop” as a possible choice of “display size”, which makes the window much larger andresizable!
  • Simulator feature: The “display size” is persisted, so when you restart the Simulator you get the same display size as before.
  • Support for LinearGradientBrush!
  • Support for StrokeDashArray (except in the Simulator)
  • Fixed issues with animations in the Simulator (“Velocity.js not defined“)
  • Added sample animation to the Showcase app (to see it, create a new project of type “Showcase”, run it, click “Other”, and scroll to the “Animations” section)
  • Ability to launch Storyboards/Animations programmatically with Storyboard.Begin()
  • A warning is displayed when a WCF service reference is not configured properly
  • Ability to define colors in XAML using the syntax <Color R=”255″ G=”255″ B=”255″/>, and new String to Byte converter for XAML types
  • Removed misleading warning “new protected member declared in sealed class
  • Fixed ExponentialEase with EaseInOut
  • Fixed an issue that caused the <ContentPresenter/> to not display the content in some situations
  • Fixed an issue where the StrokeThickness had an influence on the size of a Shape even when Stroke was null
  • Fixed an issue where a Style with a ColorAnimation would change the color of all the elements that used that Styleinstead of just the current element
  • Fixed an issue that caused animations to not find their target in some situations
  • Support for JSON Serializer/Deserializer extension (read more)
  • Support for DoubleAnimation and ColorAnimation (fluid!) (powered by the open-source Velocity.js framework)
  • Support for key frames in XAML animations
  • Support for easing functions in XAML animations
  • Support for animating RenderTransform
  • StopWatch class
  • Improved rendering of lines, rectangles, ellipses, and Path shapes
  • Design-time: improved reporting of XAML errors by providing line number and file name
  • Design-time: you can now double-click any XAML error to jump to its location
  • Ability to use a resource (image, video, audio) contained in a referenced project or assembly
  • Resources can now be accessed both via their absolute path or their path relative to the entry assembly
  • Simulator improvement: the “Loading, please wait…” message is no longer top-most
  • Simulator improvement: the scroll-bars are now inside the preview rather than for the whole window
  • Support for Width=”Auto” and Height=”Auto”
  • UpdateSourceTrigger=PropertyChanged” support
  • DateTime AddHours, AddMinutes, AddSeconds, AddMilliseconds, and comparison support
  • IDictionary and IDictionary<T1,T2> support
  • Guid equality and inequality support
  • New method “CSHTML5.Interop.ExecuteJavaScriptAsync“, which allows recursive calls to itself
  • Improved support for casting the result of “Interop.ExecuteJavaScript” to different numeric types via the “Convert” class
  • MethodBase.Invoke, MethodBase.ContainsGenericParameters, MethodBase.IsGenericMethod, MethodBase.IsGenericMethodDefinition, MethodBase equality/inequality
  • FieldInfo SetValue, IsLiteral, equality/inequality
  • Improved compatibility of “CSHTML5.Interop.LoadJavaScriptFile” with Internet Explorer
  • Improved TimeSpan.Parse
  • Resource dictionaries without code-behind now have a “public” accessibility rather than “internal”
  • Elements defined with x:Name now have a “protected” accessibility rather than “private”
  • Fixed loop when a style was “BasedOn” another style with the same name
  • Fixed “PointerExited” event in the Simulator
  • Fixed “Type not found” error when compiling XAML
  • Fixed warning “Module … has no symbols
  • Fixed Chrome for Android compatibility
  • Fixed WCF Encoding issues (characters other than English were not encoded properly, and could cause WCF to not function properly)
  • Fixed Serialization encoding issues
  • Fixed Canvas.SetLeft and Canvas.SetTop for elements that have a ControlTemplate, such as buttons (this was a regression introduced in one of the previous Beta’s)
  • Fixed StrokeThickness
  • Fixed DropShadowEffect on older IE browsers
  • Fixed setDashLine errors on older IE browsers
  • HorizontalContentAlignment” and “VerticalContentAlignment” now default to Center like on other XAML platforms
  • Improved reliability of animations inside a ControlTemplate
  • Improved layout of controls inside a Grid that has Width and Height specified in pixels, and that has only one column and row
  • Fixed a bug that cause ColorAnimations to make their target transparent
  • Margins are no longer ignored for elements inside a Canvas
  • Added MessageBoxResult and MessageBoxButton to suppot displaying OK/Cancel modal dialogs with title
  • Fixed issue where an animation with a Duration of 0 seconds threw in exception when run in the browser
  • Fixed issue where the cursor in the Simulator could be a caret rather than an arrow
  • Fixed issue where adding an empty <Line/> element to XAML could raise an exception
  • Fixed “NullReferenceException” when setting “ItemsSource” for controls that have a DataTemplate

Build C# and F# Apps on Your iPad with Continuous Mobile Development Environment

It doesn’t matter if you’re on a Windows or a macOS machine, you have access to amazing IDEs to build iOS, Android, Mac, and Windows apps and libraries with Visual Studio and Xamarin Studio. But, what if you could take all of your code on the go and with you everywhere you go? What if you could open up a code file, library, or Xamarin.Forms project on your iPad and start coding with a full professional mobile development environment with IntelliSense powered by Roslyn? That’s the experience that Frank Krueger, Xamarin MVP, delivers with his new app, Continuous Mobile Development Environment, a professional C# and F# IDE for your iOS devices.


Built with Xamarin

Frank Krueger has been developing apps with Xamarin since it first came out. He’s seen great success as an independent developer with apps including iCircuit and Calca.Continuous demonstrates the full potential that’s unlocked for .NET developers through Xamarin, with full API access across all platforms and the power of .NET.

Powered by Open Source

Powered by the open source .NET compiler platform as a service Roslyn, Continuous offers full syntax highlighting and code completion as well as documentation for over 60,000 symbols. Krueger was able to deliver rich F# support with the open source FSharp Compiler, and to bring Continuous full circle and deliver support for .NET’s standard library, all iOS APIs, and support for Xamarin.Forms, it leverages Mono and the now open sourced Xamarin.iOS and Xamarin.Forms. It’s amazing to see what can be built with these open source technologies!


Professional Development Environment

As a professional development environment, Continuous is lightning fast, has an interactive output window to see your app running live, automatic and constant debugging, and works completely offline. If that wasn’t enough, Continuous deeply integrates into iOS features and has a custom keyboard accessory for quick access to much needed keys for C# and F# development. Continuous doesn’t stop there, though—it also enables developers to carry on development in your favor desktop IDEs, Visual Studio and Xamarin Studio. You can share a single file, zip an entire solution, or collaborate with other iOS apps to synchronize with Git.

Try Continuous Yourself

You can learn more about Continuous at continuous.code and learn more about its development and release on Krueger’s blog. We want to congratulate Frank on his release of Continuous; we can’t wait to see what he and all developers building apps with Xamarin come up with next. To learn more about all of the open source projects at Xamarin, visit

The post Build C# and F# Apps on Your iPad with Continuous Mobile Development Environment appeared first on Xamarin Blog.

Explore iOS 10, tvOS 10, watchOS 3, and macOS Sierra Previews Today

Apple announced major updates to all of their operating systems and a smattering of new APIs for developers to explore at this year’s WWDC conference. sdk-icon-90x90_2xWe are excited for Xamarin developers to get their hands on these new APIs to start building beautiful native apps in C#, so today, we’re releasing our first set of previews for developers to start exploring iOS 10, tvOS 10, watchOS 3, and macOS Sierra along with supporting Xamarin-specific documentation to get you started.

iOS 10

iOS 10 has something for everyone. SiriKit unleashes the power of Siri for developers to integrate unique experiences into their mobile applications to enhance a slew of services. Notifications have been completely overhauled to schedule notifications based on geo-fencing or time and a new UI framework to allow enhanced customization has been added. This is just that start, as there are new APIs unlocked in HealthKit, HomeKit, Core motion, Foundation, Core Data, and many more as well. To get started, browse through our Introduction to iOS 10documentation.


tvOS 10

Bring your apps to life on the big screen with the latest additions to tvOS including ReplayKit to live broadcast game play, PhotoKit to share photos with iCloud Photo Library and your apps, and easily integrate multipeer connectivity to your iOS apps. To get started, check out our Introduction to tvOS 10 documentation.

watchOS 3

Take advantage of the latest watchOS release, which dramatically speeds up performance and navigation of all apps. Performance is one thing, but there are also several new APIs to play with, including Fitness and Motion with access to real-time heart rate data, gyroscope, and accelerator. Enhance your existing apps with direct access to the Digital Crown, speaker audio, in-line video, SpriteKit, SceneKit, Apple Pay, and camera data from HomeKit-enabled accessories! You can get started today with our Introduction to watchOS 3 documentation.

*This initial release of watchOS 3 has a subset of the final APIs that will be available in the future.

macOS Sierra

hero-macos_medium_2xThese Apple previews aren’t just about mobile devices, as you can also start integrating the latest APIs in macOS Sierra (10.12) into your Xamarin.Mac applications. Our Introduction to macOS Sierra documentation is a great place to start.

Installing the Previews

You can download the Previews for Xamarin Studio on macOS directly from the Xamarin Developer site for each OS: iOS 10tvOS 10watchOS 3, and macOS Sierra. You will need to ensure that you have the latest Xcode 8 Beta installed, which can be run on macOS 10.11.5 (El Capitan) or newer for iOS, tvOS, and watchOS, and macOS Sierra for macOS Sierra development. Upcoming previews will add even more support for these platforms, including support for Visual Studio.

The post Explore iOS 10, tvOS 10, watchOS 3, and macOS Sierra Previews Today appeared first on Xamarin Blog.

Announcing ASP.NET Core 1.0

The first version of ASP.NET 1.0 came out almost 14 years ago. Since then many developers have used it to build and run great web applications, and over the years we have added and evolved many, many capabilities to it.

Today we are excited to announce the release of ASP.NET Core 1.0! This new release is one of the most significant architectural updates we’ve done to ASP.NET.  As part of this release we are making ASP.NET leaner, more modular, cross-platform, and cloud optimized.  ASP.NET Core is now available, and you can start using it today by downloading it here.

ASP.NET Core is an open source web framework for building modern web applications that can be developed and run on Windows, Linux and the Mac. It includes the MVC framework, which now combines the features of MVC and Web API into a single web programming framework.  ASP.NET Core is built on the .NET Core runtime, but it can also be run on the full .NET Framework for maximum compatibility.

We challenged everything instead of delivering an incremental update so you can have an extremely modular, fast and lightweight platform perfect for the new era of software development where monolithic applications are replaced by small, autonomous services that can be deployed individually. All of that while keeping and extending what .NET is best for: developer productivity, and modern languages and libraries.

With ASP.NET Core we are making a number of architectural changes that makes the core web framework much leaner (it no longer requires System.Web.dll) and more modular (almost all features are now implemented as NuGet packages – allowing you to optimize your app to have just what you need).  With ASP.NET Core you gain the following foundational improvements:

  • Build and run cross-platform ASP.NET apps on Windows, Mac and Linux
  • Built on .NET Core, which supports true side-by-side app versioning
  • New tooling that simplifies modern Web development
  • Single aligned web stack for Web UI and Web APIs
  • Cloud-ready environment-based configuration
  • Built-in support for dependency injection
  • Tag Helpers which makes Razor markup more natural with HTML
  • Ability to host on IIS or self-host in your own process

The end result is an ASP.NET that you’ll feel very familiar with, and which is also now even more tuned for modern web development.

This is a 1.0 product which means it is just the beginning and does not have all the functionality of ASP.NET 4.x stack. For example, features like SignalR and Web Pages will come later in the year and other features like Web Forms which are deeply tied to System.Web will remain in the .NET 4.x framework. If you are an existing ASP.NET 4.x developer do not feel rushed to move to ASP.NET Core, we still plan to update Web Forms, MVC, Web Pages, SignalR on .NET 4.x as well.

If you are not a .NET developer, now it’s a great moment to try it. You can enjoy the productivity and power of .NET with no constraints, on any OS, with any tool and for any application. All of that fully open source, developed with the community and with Microsoft’s support.

Get Started Now

There are several places you can go to get a copy of ASP.NET and get started.  You can start with the website to download the latest version of .NET framework and tools for your operating system. If you’re using Visual Studio 2015, you can install the new Visual Studio SDK and get started right away. If not, choose one of the downloads for the .NET Core SDK on Windows, Mac or Linux.  Then, download the web development tools for your preferred editor and you can start building web applications with ease.

Visual Studio 2015

Once you have installed the Visual Studio 2015 tooling, you can start building a new ASP.NET Core Application with the standard File -> New Project and choosing an ASP.NET Core template from the collection of C# Web templates:

Visual Studio 2015 New Project

Note that there are three templates for Web projects:

  • NET Web Application – the ASP.NET application templates you’ve known and used
  • NET Core Web Application (.NET Core) – This will start you with a cross-platform compatible project that runs on the .NET Core framework
  • NET Core Web Application (.NET Framework) – This starts a new project that runs on the standard .NET Framework on Windows.

With a destination folder location defined at the bottom, I can click OK and will be greeted by a second set of web application template choices:

ASP.NET Core Templates

This determines which features in ASP.NET Core are initially configured in my new application.  The ‘Empty’ template will start with nothing except some middleware that outputs the text “Hello World”. The WebAPI template starts with a Controller class that will allow you to respond to RESTful requests at the /api/Values endpoint.  Finally, the Web Application template will give you an MVC framework enabled project with some Razor views, the bootstrap CSS framework and jQuery library installed.  The homepage for this application looks like the following by default:

ASP.NET Core Default Web Application

The starter template is responsive, with a simple carousel at the top and some details at the bottom of the initial home page to give you some tips and information about how you can further develop your new ASP.NET Core Web Application.

dotnet Command Line

You can also start new a .NET web application from the dotnet command line interface on any platform.  Simply execute the following command:

dotnet new -t web

This will generate a basic web application with C#, similar to the web application template in Visual Studio 2015.  There are other templates available from the command-line for C# including: console, lib, and xunittest. With the results of any ‘dotnet new’ command, you can run the project immediately by executing the following two commands:

dotnet restore
dotnet run

In the case of web applications, you will have to open the browser and navigate to the URL reported by the dotnet tool.

As this command-line tool evolves, we will add more templates and language support.


The earlier referenced Yeoman templates are available for you to use at the command-prompt as well.  Once the templates are installed, you can start building a C# application by executing:

yo aspnet

This command will present a menu where you can choose from a number of templates that are very similar to the templates that are available in Visual Studio 2015:

Yeoman Template Menu

After choosing a template, Yeoman will restore any npm and bower resources that are referenced and you can launch your new application with the dotnet commands:

dotnet restore
dotnet run

There are a number of file-templates that come with the yeoman ASP.NET Core templates.  These can be used to generate controllers, views, and other ASP.NET files that you may want to create. You can find a complete list of those templates with their usage documented on theYeoman ASP.NET Generator repository.


ASP.NET Core is a reinvention of the ASP.NET web frameworks. From the beginning of ASP.NET in 2002 the .NET server-side frameworks have been built around the concepts of modules, handlers, and integration with Internet Information Server (IIS) on Windows.  With ASP.NET Core, we have rewritten the web framework and .NET framework to better enable a modern web development experience and provide a baseline to build the next 15 years of server development.  By removing modules and handlers, which are IIS concepts, we can make ASP.NET Core run great on other web servers like Nginx and even in your own hosted application.  All application development for ASP.NET Core is built around a new middleware definition and a Controller-centric approach.

Cross Platform Support

CooperationASP.NET Core was built with other operating systems besides Windows in mind.  If you want to share code with teammates that prefer to work on Mac OS X or Linux, ASP.NET Core will allow you to collaborate with those developers and deliver the same experience with our web frameworks when targeting.NET Core.  If you and your team prefer to use Windows for all of your development, you can choose to do that as well.  ASP.NET Core enables you to work with your development team where they prefer working, and that makes everyone happy.

Visual Studio 2015 on Windows is the premier tool for creating, managing, and debugging your ASP.NET Core applications, but you can get started on any platform with Visual Studio Code.  Visual Studio Code is a lightweight text editor with plugins that support editing ASP.NET Core applications.  Additionally, it comes with plugins to manage your interactions with a Git source control provider and to Debug your ASP.NET Core applications on any operating system.

What about Containers?  ASP.NET Core now supports running in containers, with options available on for Linux and Windows based containers to host your applications.

Open Source – Source Code and Documentation

ASP.NET Core was born on the web and will be built on the web, with all source code available in our GitHub repositories.  You can navigate to the source code by starting at the repository.

You are welcome to download any and all source code and tinker with it, make any change you would like.  If you build something that works, you can submit a pull-request and we will review your changes and consider merging it.  Your code will go through the same tests and reviews that Microsoft engineer’s code will go through. We decided to make all of .NET full open source because we understand that the .NET Community is a large vibrant group of technologists that has a stake in the direction of .NET.  In 2016, all of the modern web stacks are open source and we wanted .NET on equal footing with those other tools on the market.

The documentation is open source as well.  You can find the documentation for ASP.NET Core at and each article has an “Edit this page” link on the top.  If you can improve an article, click that edit button and submit your changes.  Our documentation team will review your changes and may merge them into the document.

Edit on GitHub

There’s a brand new documentation site for all of .NET accessible at where you can learn about all of .NET Core and ASP.NET Core.  All of that content is open source as well.

Full Support for the Framework

With the change to an open source .NET, you still get great support for the framework and tools that you use.  We will provide a 3-year support lifecycle for each major and minor version release.  Major releases are indicated by a change to the major version number (1.0.0 is updated to 2.0.0) and minor releases are indicated with a change to the minor version number (1.0.0 is updated to 1.1.0)

More information about the support policy along with a placeholder for when each version, including the 1.0 release candidates, will go out of support are listed on the .NET Core Support Factsheet.

Use Only What You Need

In previous versions of the ASP.NET tools, you would have to reference libraries from the base class library in the GAC.  This would result in many libraries getting loaded into memory, like System.Windows.Forms, that weren’t really needed for your web application to generate HTML to deliver to a web visitor.  The new model will include only the framework references you need, and those references will be added as NuGet packages.

By using a NuGet package approach to managing dependencies in your project, we can deliver updates and patches to the framework through our NuGet package manager as updates and patches are ready.  Additionally, the framework can be deployed with your application in the same destination folder.  In this way, your application will not be affected by an update to the host operating system because it will continue to reference its local copy of the .NET framework libraries that it needs.


With a significant rewrite of the web framework, we addressed some performance issues and have set aggressive goals for the future.  We’re introducing the new Kestrel web server that runs within your IIS host or behind another host process.  Kestrel has been designed from the start to be the fastest .NET server available, and our engineers have recorded some benchmarks to prove it.  With the backdrop of the standard TechEmpower Benchmarks, the team used these same tests to validate the speed of Kestrel and have some impressive numbers to report:

Scenario Windows Linux
Plaintext 5.12 4.25
Json .84 .95
Mvc/Plaintext 1.2 1.02
Mvc/Json .37 .42

Values Reported are in Millions of Requests Served per Second

The first two tests use middleware to process and handle the TechEmpower test scenarios directly, while the last two tests use MVC to respond to the test scenarios.  These results have been submitted to TechEmpower and will be part of their 13th round of web performance tests.

From these numbers, the Kestrel server can handle more than 5 million requests per second, and that’s good enough for a top 10 finish among the available servers. This is our first published benchmark for these tests, and we’re going to continue improving these numbers.  If you’re interested in learning more about how we calculate these numbers or run the tests, we’ve published our source code in theASPNet/Benchmarks repository.

Dependency Injection Everywhere

ASP.NET Core comes with Dependency Injection enabled.  You’re not required to use it, but we have heard from many developers that they would prefer to have their code activated with dependency injection capabilities enabled.  For those not familiar with Dependency Injection, it is a design pattern that allows the dependencies of one class to be injected as objects are required in your application.  A common technique is to inject dependencies into a class through a constructor, and when a framework like ASP.NET Core is managing the construction of your controllers and other objects you typically cannot manage this process.

With ASP.NET Core, we are delivering a Dependency Injection container that you can use to define the dependencies that should be injected into your controllers, views, or any other class that the framework will create for you. You can get started configuring the container with the ConfigureServices method in the Startup.cs file.

public IConfigurationRoot Configuration { get; }
// This method gets called by the runtime. Use this method to add services to the container.
public void ConfigureServices(IServiceCollection services)
// Add framework services.
view rawstartup.cs hosted with ❤ by GitHub

In this method, I added the call to AddSingleton(Configuration) in order to make my application’s configuration available throughout the application.  Any class that adds a constructor with a parameter of type IConfigurationRoot will be provided the contents of the Configuration property in my Startup class.  I can even enable Razor views to have dependencies injected by using the @inject directive:

@using Microsoft.Extensions.Configuration
@inject IConfigurationRoot Config
ViewData[Title] = Home Page;
var env = Config[ASPNETCORE_Environment];
view rawindex.cshtml hosted with ❤ by GitHub

The Config object will be populated by an IConfigurationRoot type object, as defined and inserted in my ConfigureServices method.  I can then read values from the configuration by using a text-based indexer, in this case to grab the ASPNETCORE_ENVIRONMENT value.

If you’d like a container with more advanced features than our default container, there are other dependency injection containers available onNuGet that you can add to your project.  More information about dependency injection in ASP.NET Core is available in the docs.

Standard Logging is a Snap

We know that application logging is a necessity in server-side applications, and we made logging capabilities a native part of the framework. In ASP.NET Core, there is a default ILoggerFactory object created and made available to you in the Startup class’s Configure method:

// This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
public void Configure(IApplicationBuilder app, IHostingEnvironment env, ILoggerFactory loggerFactory)
view rawstartup.cs hosted with ❤ by GitHub

The default logger will log information to the console based on the configuration defined in the ‘Logging’ section of appsettings.json  There are several log severity levels defined, and this code shows that it will log anything of Debug severity or greater to the console.  The log levels available are:  Information, Trace, Debug, Warning, Error, and Critical.   With the dependency injection feature, you can have access to a logger by adding an ILogger parameter to the constructor of any class and create a logger object from there: �

public class HomeController : Controller {
public HomeController(ILogger<HomeController> logger) {
Logger = logger;
public ILogger Logger { get; }

One Framework – Not a Collection of Frameworks

In ASP.NET, we started with a single framework the delivered Web Forms with the familiar .aspx extension.  As the web changed and programming models evolved we added four other frameworks into ASP.NET.  Starting with ASP.NET Core, we are consolidating these frameworks into a single framework that is lighter and initially has the features of MVC and WebAPI. With this merged functionality of MVC and Web API, things are much simpler when you need to introduce cross-cutting concerns with your controller.  No longer do you have to consider different routing, security, or filters for an ApiController compared to an MVC Controller.  All Controller classes now handle requests using a Web API or MVC approach.  Consider the following Controller code:

public class ProductController : Controller {
private readonly ProductRepository _repository;
public ProductController(ProductRepository repository) {
_repository = repository;
public Product Get(int id) {
return _repository.Get(id);
public ActionResult Index() {
var allProducts = _repository.GetAll();
return View(allProducts);

This controller is capable of servicing a Web API GET request, responding on the api/Product route as well as handle a request for the Index page and return with the content of a Razor-based view.  This flexibility allows ASP.NET Core developers to centralize their interactions with their web visitors and reuse logic more easily than they could in prior versions of ASP.NET.

MVC Tag Helpers

With ASP.NET Core, we are also introducing a new way to generate client-side code from .NET and make it easier to re-use in Razor markup.  We call these Tag Helpers and they are referenced in your server-side markup as though they were another HTML tag that you were using. The Razor engine will recognize the tag and execute the relevant .NET Code that corresponds to it. In the default project template, you can see the environment tag helper in use inside the /Views/Shared/_Layout.cshtml file. In Visual Studio 2015, the Razor editor will highlight the use of tag helpers by marking their code in bold purple text.  TagHelpers in Visual Studio 2015Learn more about Tag Helpers in the ASP.NET Docs or you can catch the Channel 9 video discussing the feature.

Built with the Command-Line in mind

ASP.NET Core no longer requires an IDE to compile and run your application.  You can now build your application with the dotnet command line interface.  Visual Studio 2015 and Visual Studio Code provide a nice graphical interface on top of the standard command-line tools.  This way, you can use your favorite editor to write .NET code and get the same compilation results as your friends who prefer Visual Studio.  You will also have the same compilation experience on your continuous integration services that you have on your development workstation. More information about the new .NET Core and .NET Command Line interface released today is covered on the .NET Blog.

Yeoman Generators

We’re also providing baseline templates that work on all environments if you use the Yeoman template tool.  Yeoman is a tool to help you scaffold source code, and we are providing the generator-aspnet package that will help you get a new web application up and running.  Use npm to install Yeoman with the command:

npm install -g yo

Then you can install the templates with

npm install -g generator-aspnet

You can then start building a new ASP.NET Core application with the command:

yo aspnet

The source code for these templates is available on GitHub at:

Ready for the Cloud

Many customers have told us that they want to be ‘cloud ready’ and be able to move their server-side applications easily into the cloud.  ASP.NET Core has a number of key features that make it ready for the cloud. We’re delivering a cache provider that runs on Redis, so that you can upgrade your in-memory cache for the cloud when you’re ready to scale out your application to many servers.  Add the Redis cache provider to your project with the Microsoft.Extensions.Caching.Redis package and you can configure the Redis distributed cache provider in your ConfigureServices method with code like the following:

  provider => new RedisCache(new RedisCacheOptions  {    
    Configuration = "redis_connectionstring",    
    InstanceName = "myRedisInstanceName"  

By using the dependency injection container, I can ask for an IDistributedCache object in the constructor of my controllers and work with the contents of the cache based on the value passed in to that constructor.

public HomeController(IDistributedCache cache) {
this.Cache = cache;
public IDistributedCache Cache { get; private set; }
public IActionResult Index() {
ViewBag.CachedValue = Cache.Get(myCacheKey);
return View();

We have also made significant advances in configuration management of our web applications.  In other frameworks, you might store your database connection information, cloud storage API keys, or other secrets directly in your configuration files. A quick search of GitHub has revealed too many of these keys in the past, and we want to enable you to hide these values while providing a good experience for operations teams that manage the deployment of these secrets to a production environment.  With ASP.NET Core, we’re introducing the SecretManager command-line tool to help you store these values where they won’t be accidentally picked up by your source control tool.

The secret manager is enabled by default in Visual Studio 2015 and dotnet new templates.  If its not enabled in your project, add it to your project by adding this entry to the “tools” section of project.json:

"Microsoft.Extensions.SecretManager.Tools": {
  "version": "1.0.0",
  "imports": "portable-net45+win8+dnxcore50"

There will also be an identifier at the top of the default project.json file that indicates the name of the project for the secret manager.  In a sample project.json file, it looked like this:

  "userSecretsId": "aspnet-WebApplication-0799fe3e-6eaf-4c5f-b40e-7c6bfd5dfa9a",

You can then reference the secret values stored by the secret manager by adding a reference to the Microsoft.Extensions.Configuration.UserSecrets package.  In the default templates, there will be an entry in the constructor of the Startup class that loads configuration values from the secret manager:

if (env.IsDevelopment()) {



This will overwrite any configuration options loaded from a configuration file with the contents of the secret store.  The secret store actually isn’t too secret, its just a set of JSON files hidden in your user profile folder.  If the usersecrets files are not found, this command will fail silently. In Visual Studio 2015, you can access and manage this file’s content directly by right-clicking on the project and selecting the ‘Manage User Secrets’ context menu.  If you are working on the command-line, you can set a value with the command:

dotnet user-secrets set name value

Other options for the dotnet user-secrets command-line tool can be found by calling

dotnet user-secrets -h

More information about the secret manager can be found in the ASP.NET Core docs.

To help with the management of the application on the production space, we’ve introduced an easier way to load configuration through environment variables.  In the previous sample code, you saw a call to env.IsDevelopment()  This is a check that the current environment is named “Development”.  By default, when you debug an application from Visual Studio 2015, an environment variable called “ASPNETCORE_ENVIRONMENT” is set to the value “Development” and ASP.NET Core can interpret that value and make features available to the Development environment only.  If that environment variable is NOT set, ASP.NET Core assumes that you are running in Production.

In the same Startup class’s constructor method, there is a default call to builder.AddEnvironmentVariables()  This applies any configuration values that are stored in environment variables to your application.  You can configure your cloud services or dockerfile to set environment variables appropriate for your application and they will override any prior configuration value provided.

Bundling and Minification

We’re updating our approach for bundling and minification of static web files to use a Visual Studio extension called ‘Bundler and Minifier’  This extension replaces the previous methods of writing ScriptBundle and StyleBundles or using another tool to operate on your files.  With Bundler & Minifier you can right click on the files to concatenate or compress and Visual Studio will act on them appropriately.  The extension will record your actions in a bundleconfig.json file so that your project changes can be synchronized with source control.

You can learn more about the Bundler & Minifier extension on its GitHub repository and from Mads Kristensen on the ASP.NET Community Standup.

Migration from RC2

If you are migrating from the RC2 release, there are a small number of breaking changes that you should be aware of when updating your code.  These are all edge scenarios if you are doing more advanced customization of your application, and should not affect everyone.  Among the changes that you may need to be aware of are:

A detailed list of changes is available in the ASP.NET Announcements Issue List.

What’s Next?

The ASP.NET Core team is moving forward with bringing more web capabilities into the Core framework that we have heard our customers want.  Look for us to start working on a new version of our SignalR real-time web application capabilities that you may have used in prior versions of ASP.NET.   We’re also researching how to bring the ‘Web Sites’ project model from ASP.NET into the Core framework by supporting something we’re calling ‘Controllerless Views’.

To keep up to date on the discussion and direction of ASP.NET Core, make sure you tune in to our team leads weekly video broadcast  If you can’t make the live show each Tuesday, then the recordings are made available on the website.  The team reads your comments and will respond.

Should I Switch Today?

We’re excited about the new release of ASP.NET Core, and we think you will be too.  A lot has changed from ASP.NET 4.6 and we think this new product is ready to start taking production workloads.

If you have a new web application to build, try ASP.NET Core.  If you want to build a new application that will be deployed to a Docker Container, try ASP.NET Core.  Perhaps you want to build a micro-service that will be interacting with an existing application, we think you should try ASP.NET Core.

If you have a 10-year old application that your company relies on, we don’t recommend attempting to port it to ASP.NET Core.  We’ve found that the process to move an application from ASP.NET MVC to ASP.NET Core is as significant as the transition from ASP.NET Web Forms to ASP.NET MVC.  We recommend that you look at the switch of an application to ASP.NET Core as a rewrite instead of a migration.


We’ve made some large changes to the ASP.NET Core product for this release.  If you are using ASP.NET 4.6, you can still use those frameworks and libraries.  They are a hardened toolset that we will continue to support and update, with patches planned for the upcoming “VS15” product.  If you’re building a new application or you need to build an application that runs cross-platform, perhaps in a container, download ASP.NET Core and give it a try.  With our fully open, fully cross-platform .NET framework and libraries there is no reason not to use ASP.NET Core and .NET Core.  The tools will make your job and the performance will make your customers happier.

How to be Successful with Mobile DevOps

By Anusha SethuramanJune 24, 2016

Anusha Sethuraman

The rise of smartphones and changing user behavior over the past seven years have forced organizations to start delivering more and more mobile solutions, with apps a big part of this. There are unique challenges when it comes to enterprise mobile app delivery, however. The ecosystem is fragmented, yet users continue to have high expectations. It’s the “age of the customer” as Forrester puts it, and enterprises need to not only live up to their expectations but exceed them in order to stay competitive.“After an unsatisfactory experience with a mobile business app, 65% of users will abandon the app after two or fewer uses and 8% will abandon immediately.”
–Xamarin Mobile Business User Survey, 2015

Speed, quality, and continuous iteration are critical to the success of mobile apps, no matter if the audience is comprised of customers, internal employees, or business partners. DevOps can provide an efficient way to embrace this complex ecosystem and streamline mobile app delivery for building, testing, and continuously iterating. The concept of DevOps is not new, and companies have been implementing it for a few years now, but how do you take this to the mobile world and address the unique requirements there?

Download our Mobile DevOps Overview whitepaper to learn more about:

  • The unique challenges of enterprise mobile app delivery
  • Why you should consider implementing DevOps in your mobile lifecycle
  • The challenges with applying DevOps to mobile
  • How to implement DevOps in the mobile lifecycle and be successful with it
    • Why starting with people and culture is critical
    • Creating a living, breathing plan that you can constantly update based on market changes and user feedback
    • Being smart and efficient about how you build your apps
    • Taking into account all of the integrations that mobile apps have and planning ahead for easy scalability
    • Treating testing as an enabler of DevOps and not a bottleneck
    • Continuously iterating to keep up the quality of the apps, and keep users engaged


Get the white paper


Adding Facial Recognition to Your Mobile Apps

By Pierce BogganJune 22, 2016

Whether it’s automatically tagging friends in our Facebook photos or “live filters” on Snapchat, facial recognition is increasingly becoming a large part of our everyday lives. Adding facial recognition to software in the past was extremely challenging, however. Now, though, Microsoft Cognitive Services makes it as easy as a few lines of code—for free.Whether you’re building consumer or enterprise applications, there’s a Microsoft Cognitive Services API that will make your app more innovative and pleasant to use. In this blog post, you’ll learn how to add facial recognition with Microsoft Cognitive Services’s Face APIs to an employee directory app, so we can identify an unknown employee from a photo.


Introducing the Face APIs

Microsoft Cognitive Services lets you build apps with powerful algorithms in just a few lines of code, providing 22 APIs that use artificial intelligence and machine learning to do everything from OCR, to speech and
facial recognition. APIs are broken down into five main groups: vision, speech, language, knowledge, and search. The Face APIs from Microsoft 2016-06-21_1746Cognitive Services allow you to detect human faces, organize people into groups, find similar faces, and identify previously-tagged faces in images.

Xamarin has grown a ton over the past few years, and sometimes it’s tough to know exactly who everyone is. The great thing about Microsoft Cognitive Services is it’s not only great for innovative apps, but for all types of apps, including apps built for the enterprise. In this blog post, let’s build an employee directory app that identifies an employee from a photo to help ensure I don’t get into an awkward situation at a company party if I don’t know someone I should.

To get started for free, visit the Microsoft Cognitive Services subscription page, and subscribe to the Face APIs. Once registered, you should have a free subscription to the Face APIs, including API keys.

Subscription page for the Face APIs, including API keys.

Download the starter code for the Xamarin employee directory app, which we’ll extend to use facial recognition to identify employees from a photo.

Identifying Employees with Facial Recognition

To identify a person in a photo, we must first train the facial recognition model. Identifying the person in a photo is as easy as these four steps:

  1. Create a person group.
  2. Add people with corresponding faces to that person group.
  3. Train the facial recognition model.
  4. Detect and identify the people in a photo.

Training the Facial Recognition Model

To get started, open EmployeesViewModel and add a new method named RegisterEmployees. We start off by creating a new person group, which is just a container for a group of people. After we’ve created a person group, we need to add people to that group. Each person also needs one or more faces from which we can identify them. Finally, we need to train the person group. This will identify the unique features of a each face that can later be used to identify a person.

In production, the process of creating a person group, adding people and faces, and training the model would probably be done on your backend. For example, when you provision a new employee on your backend, a new person (and corresponding face) would automatically be added and the model would be retrained.

Next, call RegisterEmployees from the constructor of the EmployeesViewModel to ensure that we are configuring our facial recognition model at startup. We’re now ready to identify employees!

Facial Detection and Identification

Now that we’ve properly trained our facial recognition model, we can use Microsoft Cognitive Services to identify a person from a photo. Because we’re using the MVVM pattern in our employee directory app, we can use commanding to respond to events on our user interface and execute code in our view model. Navigate to the ExecuteFindSimilarFaceCommandAsyncmethod in EmployeesViewModel, which is a backing method for our command where we’ll write the logic to identify an employee.

First, we need to take a photo from which we can identify an employee. We can use the Media Plugin for Xamarin and Windows to take or select photos from shared code:

Now that we have a photo, let’s pass that to Microsoft Cognitive Services to identify the employee:

That’s it! All of our facial recognition logic is now complete. Jump over to EmployeesPage.xaml, where we’ll add aToolbarItem to the navigation bar for users to click on to launch the camera and identify an employee:

We can now identify employees. The great thing about Xamarin.Forms is you can both build great mobile apps that run on iOS, Android, and Windows 10 mobile, but also desktop apps with Xamarin.Forms for UWP. Let’s identify a photo of me using the employee directory app and a Windows 10 laptop:


Video Player


Wrapping Up

In this blog post, we used Microsoft Cognitive Service’s Face APIs to identify an unknown employee from our employee directory by taking or selecting a photo. To learn more about Microsoft Cognitive Services, watch the “Build ‘Smart’ into your app with Microsoft Cognitive Services” session from Xamarin Evolve 2016. For more examples of using Microsoft Cognitive Services to build smart mobile apps, and to download the complete code for this blog post, check out my smarter-apps GitHub repository.