WinRTC: Microsoft’s Newest WebRTC Port

This post is largely stream-of-conciousness as I work through the process of trying to build and use Microsoft’s WinRTC project: their newest WebRTC solutions for native applications. This isn’t a tutorial, but hopefully my notes and the issues I run into will save you time when you get to the same points.


For years, I’ve mostly focused on LAN-limited realtime data use cases. I’ve sent basically anything I could think of over local and LAN TCP/UDP sockets. The local approach worked well, and had security benefits for secure applications like medical data, which often can’t leave a closed network. Plus, code was native, easy to write, and easy to debug.

Coronavirus changed the playing field: the coworkers with whom I usually share a LAN now aren’t even on the same side of town. VPN’s sometimes work well enough, but many of my peers don’t have symmetric gigabit at home. Overnight, the assumptions made when developing LAN-based apps for local ethernet (or even decent wifi) were astonishingly incorrect.

Considering that multiple project’s I’m currently working on depend on (or would at least benefit from) more robust data transfer, I decided to catch up with industry standards. With some quick googling, it became obvious that one approach dominates the realtime market: WebRTC.

What is WebRTC?

Google realized in early 2013 that the possibilities presented by real-time, cross-platform, cross-NAT data streaming are endless. They, alongside industry partners like Mozilla, Opera, and others, released an Open Source project called WebRTC in early 2013 that aimed to implement most major protocols and APIs for video/audio capture, transmission, and playback into a single, cross-platform project. Over the last seven years, Apple (and recently Microsoft) joined the effort, resulting in near universal cross-platform support for realtime audio and video in browsers.

Over time, the protocols and APIs developed for WebRTC became official standards. As standards were adopted, companies started to wrap WebRTC into libraries for their platforms to allow native applications to communicate in real time. Microsoft’s first effort at this wrapping process was the recently-deprecated WebRTC for UWP project. This project, though successful in bringing WebRTC to native Windows applications, was developing in parallel with the offical WebRTC project. Dependencies were often problematic, and the UWP packages tended to significantly lag official WebRTC or Chromium releases.

WinRTC is Born

With pressure mounting to better integrate Windows support for WebRTC, Microsoft shifted gears: they announced the deprecation of their WebRTC fork, and started back-contributing the project to the official WebRTC codebase. They also announced the birth of a new project: WinRTC.

“The WinRTC project aims to host everything needed to build apps with interoperable real time communications for modern Windows.” 

WinRTC Github Repository Readme

WinRTC’s goal is to bring WebRTC capability to all modern native Windows languages and platforms – including C#, C++, and VB. The efforts were announced publicly by the project’s maintainer Augusto Righetto at Microsoft’s //Build 2020 conference:

WinRTC Project Introduction at //Build 2020

It’s clear that WinRTC will be crucial to Microsoft’s realtime communication’s plans going forwards – especially since their own Edge browser is now a Chromium-derived product. Since Righetto’s demonstration of the “Getting Started” process looked fairly straight forward, I decided to try it myself. This post documents the process of building and using the new WinRTC Github project so that anyone interested can save some time and get coding faster!

Building ‘WinRTC’ from Source

Before we can build the MyFirstWinRTC solution talked about in the video above, we need to first build a patched version of WebRTC that plays nicely with Win32 UWP applications. Since MSFT is back-contributing all of their patches to WebRTC, the following patching process hopefully won’t be necessary forever. I’ll add a note here once the following steps aren’t needed. (They also say there’s hope for a WebRTC nuget package sometime soon? That would be awesome…but I’m not holding my breathe.) In the mean time, lets get started!

Environment Setup

The following steps basically mirror the official patch instructions from the WinRTC repo. I’m including copies of the files I’ve used for my builds as zip files in this post so that even as their repository is in flux, this post will still yield a working build.

Hardware Note

Before we can build WinRTC’s patched copy of WebRTC, we need to set up a Windows PC instance as our build machine. The official repository recommends the following minimums:

CPU: 64-bit Intel OS: Windows 10 (18362 or higher)
Memory: 16Gb minimumVisual Studio 2019 (16.6 or higher)
Disk: 15Gb empty, NTFS formatDesktop C++ and UWP Workloads
C++ MFC and ATL Build Tools
Windows SDK Debugging Tools
Although Command Prompt will work, Windows Terminal is recommended.

Since this setup is relatively specific and bulky, I’m going to spin up a clean Windows 10 VM on my ESXi box:

Hardware Specs: ESXi VM || 12 vCPU || 64Gb RAM || 128Gb SSD

By using a totally fresh VM instance, I’m able to set up my environment and take a snapshot of it before and after installing my tools. This gives me flexibility to always return to a point in time if needed. Considering how integrated Visual Studio is with the Windows Registry (and the fact there’s no way to install it completely on an external disk), a VM felt like a safe bet for giant experimental package compilation. Obviously, this isn’t an option for everyone – but the setup steps should be otherwise the same:

Software Installation

First, I used Windows Update to pull the most recent everything. We’re going to be compiling code from Microsoft’s internal bleeding edge – let’s be as close to their platform as possible, without being on an Insider Preview Build. For my VM, that meant updating to the most recent Win10 available from within Windows update.

Downloading the WinRTC Project

Since WinRTC is an open source project available on Github, my first step was getting a copy of the repository to build and modify myself.

Note: I use Github Desktop in this post – I highly recommend it. Github really did a great job making repos easier to manage / harder to break.

Since I wasn’t planning on making edits to Microsoft’s code (at least, not edits I’d be sharing with the world), I needed to clone the repository, not fork it. If you need a refresher on cloning and forking, check out GitHub’s post about the topic. Cloning the WinRTC repository is easily done from the project’s Github page: https://github.com/microsoft/winrtc

Click on “Clone or Download”, then Select “Open in Desktop”

The Github Desktop application automatically opened, giving me the chance to choose where my local copy of the code will live: I left it in the default ~\Documents\Github\winrtc directory. Then, clicking clone downloaded the entire repository to my pc:

Choose where your local copy of the repository will live on your machine.

When the project finished downloading, I clicked “Show in Explorer” to open up my newly downloaded repository.

With all the code I need downloaded, I was ready to start working on building the patched WebRTC project myself.


For More Information

In addition to the project introduction and overview, Microsoft hosted a Q&A session with the WinRTC team during //Build. Check it out if you have more questsion about the project, where its going, and how it fits into the Windows ecosystem goign forwards.

WinRTC Expert Q&A from //Build 2020

Leave a Reply

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

This site uses Akismet to reduce spam. Learn how your comment data is processed.