The Windows Command-Line: Windows Terminal & WSL 2 (SK135)

Kayla Cinnamon and Craig Loewen

  1. Windows Terminal
    1. Version 1.0 has shipped!
    2. Links
      1. Windows Store: https://aka.ms/terminal
        1. Stable channel with monthly releases.
        2. First update after v1.0 scheduled for July 2020.
      2. Windows Terminal Preview in the Store: https://aka.ms/terminal-preview
        1. First update scheduled for June 2020.
      3. GitHub Repo: https://github.com/microsoft/terminal
      4. Blog: https://aka.ms/cliblog
      5. Docs: https://aka.ms/terminal-docs
    3. Demo
      1. You can tell that the application for PowerShell and cmd.exe are the same by examining their property pages.
      2. People wanted tabs, panes, background colors, background images, more fonts, etc.
      3. Will render Unicode and UTF-8 which allows for foreign languages, emoji, etc.
      4. Backward compatibility prevented this for the old application hosting cmd.exe and PowerShell.
      5. Windows Terminal dynamically detects your WSL distros and adds entries for them to your profile list.
      6. Add any settings that you want to apply to all of your profiles to the "defaults" section of settings.json.
      7. She showed her “Build” color scheme.
    4. Keyboard Shortcuts (Default)
      1. Ctrl+Shift+T: Open a new tab with your default profile.
      2. Ctrl+Shift+n: Open a new tab with profile # n.
      3. Ctrl+Shift+F: Find text in the window.
      4. Ctrl+,: Open settings.json in your default JSON editor.
      5. Alt+Settings: Show global settings (defaults.json).
      6. Alt+Shift+D: Open a new pane (i.e. Duplicate).
      7. Ctrl+Shift+W: Close the current pane or the entire Terminal if only one pane is present.
    5. Command-Line Parameters
      1. wt -h or wt --help: Display command-line parameters.
      2. wt -d . : Opens a new Windows Terminal in the current directory
      3. cmd.exe: wt -d . ; split-pane -p "Windows PowerShell" -H
      4. PowerShell: wt -d . `; split-pane -p "Windows PowerShell" -H
    6. Experimental Features
      1. Add the following line to your settings.json file.
      2. "experimental.retroTerminalEffect": true
      3. I had to open a new cmd.exe tab in order to see this take effect.
      4. Kayla used the PxPlus IBM VGA8 font with the retro effect.
    7. Customize Your Color Schemes
      1. https://docs.microsoft.com/en-us/windows/terminal/customize-settings/color-schemes
      2. More sample themes: https://github.com/mbadolato/iTerm2-Color-Schemes/tree/master/windowsterminal
      3. Also see the Terminal team’s ColorTool to apply color schemes.
    8. What’s Next
      1. Color Picker for your tabs.
      2. Rename tabs.
      3. Settings UI (not coming in June).
  2. WSL (Windows Subsystem for Linux) 2
    1. Access all of your Windows files directly from the Linux environment.
    2. Run Windows executables from a bash (or other) shell.
    3. You can also go the other way:
      1. Access Linux files from Windows.
      2. Invoke Linux binaries from Windows.
    4. Includes a real Linux kernel built by Microsoft.
    5. Running in a lightweight VM.
    6. WSL 2 is typically 3-6x faster than WSL 1.
    7. Docker Desktop client for Windows can now use WSL 2.
    8. VS Code Remote will build Linux apps from a Windows UI.
    9. WSL 2 provides File Explorer integration to your Linux file system.
      1. Each distro looks like another folder.
    10. wsl --installenables all required optional components.
      1. Requires a reboot.
      2. Then it will install your specified distro.
    11. GPU compute is the # 1 requested feature and will be coming to WSL in the future.
      1. Enables parallel computing.
      2. Much faster on a GPU than a CPU.
      3. Machine Learning and AI development both benefit.
      4. Image filtering is just matrix math.
      5. For example, AI determines that the user drew the number 2.
      6. nVidia Drive Net demo.
        1. Analyze images to find where people and cars are.
      7. Training Data -> ML Algorithm -> Trained Model
      8. The ML Algorithm depends on an ML Framework.
      9. Framework could be TensorFlow or pyTorch.
      10. Those depend on hardware acceleration APIs like CUDA or DirectML.
        1. For DirectML, it can leverage any DirectX 12 GPU.
        2. This is great for students who may not have nVidia CUDA graphics cards.
      11. Those APIs call into the GPU on your machine.
      12. The WSL team has changed the Hardware Acceleration API layer.
      13. They have partnered with hardware vendors like nVidia, AMD, and Intel. 
      14. They have provided drivers that are aware of WSL.
      15. The team has also made changes internally to WSL and to the Microsoft Linux kernel to make this possible.
      16. Make sure you have WSL installed: https://aka.ms/wslinstall.
      17. Install the right driver for your GPU.
        1. Instructions will be available when these changes are released to Windows Insiders.
      18. Run your Linux ML workflows inside of WSL!
        1. Open your WSL distro, git clone your project, and get started.
    12. GPU Demo
      1. He has a folder with SqueezeNet.
      2. It’s a popular image recognition neural network.
      3. He can run Python to train it.
      4. You can see the GPU being used (actually spiking) in Task Manager, Performance tab.
      5. You can run these workflows across different GPU vendors!
    13. What’s Next for WSL?
      1. wsl.exe --install to allow one command installations will be available in the next few months.
      2. GPU Compute in WSL will be available in the next few months.
      3. GUI application support in WSL will be available, but not in the next few months.
    14. Demo of GUI Application Support
      1. In one command window, he’s got the Wayland Compositor running.
        1. Running a Wayland server inside of Linux and connecting this to an RDP client on the Windows host machine.
        2. wlwsld --debug --wl-debug
      2. In the other, SpaceInvadersDeepQLearning.
        1. He switched into the media folder.
        2. Ran eog, eye of gnome.
        3. Then he restarted the Wayland server, moved up a directory, and ran gedit.
        4. Then he restarted the Wayland server again and ran mpv file.mp4 to really put it through its paces, i.e. playing a video file.
    15. Links
      1. Twitter: @craigaloewen
      2. WSL Github: https://github.com/microsoft/wsl
      3. WSL Docs: https://aka.ms/wsldocs

Creating Microsoft 365 apps with Microsoft Graph Toolkit

Wednesday, May 20, 3:30 PM – 3:45 PM EDT

Nikola Metulev, Microsoft (@metulev)

I had really wanted to see Nikola build a Toolkit app from end-to-end, but he only had 15 minutes for the entire demo and discussion.  Here are the links I think I need to be able to build the demo.

  1. https://docs.microsoft.com/en-us/graph/toolkit/get-started
  2. https://docs.microsoft.com/en-us/azure/active-directory/develop/quickstart-register-app
  3. https://docs.microsoft.com/en-us/graph/toolkit/providers/msal
  4. https://graph.microsoft.com
  5. https://mgt.dev
  6. https://aka.ms/mgt

This blog post also looks very helpful:

  1. https://cmatskas.com/accelerating-ms-graph-development-with-the-new-toolkit/

Here is the HTML page that should make it all work:

<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
    <script src="https://unpkg.com/@microsoft/mgt/dist/bundle/mgt-loader.js"></script>
  </head>
  <body>
    <mgt-msal-provider client-id="insert GUID here"></mgt-msal-provider>
    <mgt-login></mgt-login>
    <mgt-person person-query="beth" person-card="hover"></mgt-person>
  </body>
</html>
  1. Version 1.3 of the Toolkit should be released in a few weeks.
  2. It was built with Web Components, which are supported by all major browsers and frameworks now.  They are natively rendered by the browser.
  3. The Toolkit eliminates all of the boilerplate code that was previously necessary.

The Journey to One .NET – Live

Wednesday, May 20
12:00 PM – 12:30 PM EDT

Scott Hanselman, Microsoft; Scott Hunter, Microsoft

  1. Demo: Created a Blazor WebAssembly app in VS
    1. You can check PWA.
    2. Showing local variables in the browser while debugging, which has only worked for a couple of months.
    3. Can debug the backend API in VS.
      1. Set breakpoints.
    4. This is full-stack debugging.
    5. He clicked “Fetch Data” and it broke in VS in the backend.
    6. He also created a desktop app with this that showed up in the Start Menu.
      1. Offline web apps.
      2. Blazor will do this for you.
  2. .NET Core 3.1
    1. Go live with .NET Core 3.1.
    2. LTS is three years long.
    3. Blazor WASM is now GA.
    4. https://dot.net/get-core3
  3. .NET 5 to 6 “Wave”
    1. It will take two iterations to complete.
    2. Xamarin today is using Mono BCLs.
    3. Merging to .NET BCLs.
    4. Same unified tool chain.
    5. Will work across all workloads.
    6. Native controls.
  4. Demo: Hanselman showing ASP.NET Core
    1. Showing <h2>@Environment.OSVersion</h2> under Windows.
    2. Changed to running in WSL.
    3. Now shows Unix 4.19.84.0, which is the WSL2 kernel.
    4. Showing a Dockerfile.
    5. All your work can be done in Docker.
  5. Cross-Platform Native Apps
    1. .NET MAUI – Cross-platform, native UI
    2. Runs on top of .NET Platform
    3. Single project, single codebase.
    4. Evolution of Xamarin.Forms.
    5. Targeting .NET 6.
    6. Now he can run a Xamarin app on Windows, not an emulator.
    7. Works on Windows and Mac.
    8. Reflector is showing his iPhone on his desktop.
    9. No longer separate projects for each targeted device.
  6. .NET Conf 2020
    1. November 10-12, 2020
    2. They ship .NET every November.
    3. .NET 5 launch.
    4. Free, three-day, virtual event.
    5. https://www.dotnetconf.net
  7. I OCR’d the following text out of the above image using the OCR code sample from https://github.com/microsoft/Windows-universal-samples/tree/master/Samples/OCR.
    1. Watch the longer on-demand session: https://aka.ms/dotnetjourney
    2. Give us your feedback: https://aka.ms/dotnet5feedback
    3. Sign up for a free year of CODE Magazine: https://codemag.com/subscribe/build2020

Everything you need to know about WinUI

Ryan Demopoulos, Microsoft; Miguel Ramos, Microsoft

Wednesday, 20 May 2020, 9:45 to 10:15 am EST

  1. What is WinUI and what can it do for you?
  2. 1992, MFC, OO framework for Native C++.
  3. 2002, WinForms, .NET Framework.
    1. Like MFC, wrapped common controls.
    2. Left MFC for native.
  4. 2006, WPF, .NET Framework.
    1. Good for desktop.
    2. Not everybody needed all of this power, so lots of people stayed on WinForms.
  5. 2012, UWP XAML (for Windows 8), Metro/Store apps, C++ & .NET.
    1. Most advanced, state of the art UI framework.
    2. Fluid
    3. More devices and inputs.
    4. Should have replaced all the old frameworks.
    5. Not exactly.
    6. Only works with UWP apps, which doesn’t help the previous models.
    7. MFC, WinForms, WPF are Desktop (Win32) Apps.
    8. UWP XAML is for UWP Apps.
  6. WinUI is the Windows UI Library.
  7. WinUI 2
    1. Shipped in Oct 2018.
    2. Used in UWP Apps.
    3. Includes all the latest Controls and Styles.
  8. WinUI 3 combines UWP XAML and WinUI 2
    1. Ships independently of the OS.
    2. Works in any type of app: desktop, UWP.
    3. WinUI 3 will provide a state-of-the-art UX framework for every Windows developer.
      1. Cutting edge fluent controls.
      2. Implemented in C++ for any app (Native or managed).
      3. Ships separately from the OS, so you choose when to upgrade.
      4. “A” UX framework, not “the” UX framework.
      5. You choose what you use, e.g. WPF, WinForms, MFC.
      6. It doesn’t replace the ones of the past, gives you a new choice.
      7. It’s the next version of UWP XAML.
  9. What’s coming?
    1. Feb: Refreshed alpha.
      1. Inlcudes WebView2.
    2. May 2020: WinUI 3 Preview 1.
    3. Jun 2020: WinUI 3 Preview 2.
  10. Demo: Miguel
    1. Install the WinUI 3 Project Templates extension from VS.
    2. WinUI 3 with .NET 5.
    3. Microsoft.WinUI NuGet package.
    4. C# 8.
    5. Folder Inspector app (.NET Desktop WinUI 3 app)
    6. No security sandbox!
    7. It’s calling Win32 APIs!
    8. Using C++ 17!
  11. https://aka.ms/winui
  12. WinUI 3 Preview 1 Customer Highlight: esri demo
  13. Uno Platform is exploring using WinUI 3.
  14. React Native is also.
  15. chorus Encore is an example app using WinUI to help people with autism
    1. Showed a video.
  16. I OCR’d the following text out of the above image using the OCR code sample from https://github.com/microsoft/Windows-universal-samples/tree/master/Samples/OCR.
  17.  WinUI
    1. Website: https://aka.ms/winui
    2. Community Call: https://aka.ms/winui/maycall
    3. Preview 1 Notes: https://aka.ms/winui3/preview1
    4. GitHub: https://aka.ms/winui/github
    5. Preview 1 Blog: https://aka.ms/winui3/preview1blog
    6. XAML Controls Gallery (XAML Controls Gallery app): https://aka.ms/xamlcontrolsgallery
      1. Last updated for WinUI 2.2 as of 20 May 2020.
  18. Community
    1. #win-ui on Discord! https://aka.ms/winui/discord
    2. Uno Platform: https://platform.uno/
    3. Uno CH9 app: https://github.com/unoplatform/Uno.Ch9
    4. Telerik UI for WinUI: https://www.telerik.com/winui
    5. WCT using Preview 1 (Windows Community Toolkit): https://aka.ms/wct-winui3
  19. Related Sessions
    1. Live: Unifying & evolving the Windows app platform
      1. Paul Gusmorino, Jesse Bishop | INT111
        1. Tues May 19 2:45 PM-3:15 PM PDT https://aka.ms/M365INT111A
        2. Wed May 20 6:00 AM -6:30 AM PDT https://aka.ms/M365INT111B
        3. Wed May 20 11:00 PM-11:30 PM PDT https://aka.ms/M365INT111C
  20. Skilling Sessions
    1. WebView2: Bringing the best of the web to your native apps
      1. Limin Zhu | SK128 | https://aka.ms/M365sk128
    2. Fluent Design System – Building apps that feel natural on every device
      1. Paul Gildea, Chigusa Sansen | SK131 | https://aka.ms/M365sk131
    3. React Native: Build cross platform apps that target Windows, Mac, and more!
      1. Kiki Saintonge, Steven Moyes | SKI 19 | https://aka.ms/M365sk119
  21. Question: How do MAUI and WinUI relate?
    1. Answer: WinUI 3 is the native Windows framework.  Apps for Windows is WinUI.  MAUI is cross-platform.  Having conversations to overlay MAUI on WinUI 3.
  22. Question: Will any features of WinUI 3 be C++ only?
    1. Answer: No.  The Windows Community Toolkit will only work on .NET.  But they may integrate them back into WinUI.
  23. Question: Can you have different WinUI versions on the same computer?
    1. Answer: Cannot use multiple versions in the same app, but definitely on the same machine.
  24. Question: Will XAML islands be necessary.
    1. Answer: If your whole UI is WinUI, then no.  But if you’re using some WPF, etc., then yes.
  25. WinUI 3 is really the next version of UWP XAML.
    1. How do you convince someone to move to WinUI from WPF or WinForms?
  26. Question: Can you upgrade an MFC app or WinForms app to WinUI.
    1. Answer: Migration (slowly) is planned.  Separate your concerns using MVP or MVVM pattern to help.  WinUI + Islands will be ready in the future.
  27. https://aka.ms/winui/discord

Visual Studio 2019 (remote dev) tips & tricks

Mads Kristensen, Microsoft
Wednesday, 20 May 2020, 9:00 to 9:30 am EST

  1. How to work from home more effectively.
  2. Showing how to change VS 2019 pane layouts with keyboard shortcuts.
  3. Shift tabs to left-hand side so you get more vertical resolution for your code windows.
  4. You can also sort your tabs in different ways, e.g. alphabetically.
  5. If you have an under-powered PC, how can we help VS?
  6. Lots of projects loaded in your solution.
  7. The next time you open the solution, VS has to reload all that state.
  8. He changed options to not restore all that state.
    1. Rewatch to find where he changed those options.
  9. He switched to his web development window layout.
  10. Minimized tool windows are not loaded.
  11. “Reset Tool Windows” extension.
    1. Tools / Options / Startup / Reset Tool Windows
    2. Solution Explorer should be the only option you leave set to True.
    3. Visual Studio starts much faster.
  12. Clicked “Connect to Codespace” in the File menu.
  13. Opening a Git repo.
  14. Clicked “Create”.
  15. All of his updates in a local VS instance are available through the Codespace in the cloud.
  16. It will look exactly the same in both.
  17. He brought up Task Manager.
  18. Using 26% CPU.
    1. Screen sharing, broadcasting, VS, etc.
  19. He rebuilt the solution.
  20. His local machine is not affected because it’s all happening in the Codespace in the cloud!
  21. He can have multiple instances of VS running and it will have minimal impact on his machine.
  22. Some of these features are only available in the preview version of VS 2019, e.g. Codespaces.
  23. https://aka.ms/vsfutures-signup
  24. Enable preview features in Tools, Options.
  25. He install the New File extension as soon as he installs VS.
  26. Shift-F2 will create new files, will create types inferred from the name, e.g. IFoo will create an interface.
  27. Can directly type folder paths in the dialog.
  28. Watch Mads’ pre-recorded session for on-boarding a dev environment.
    1. Takes seconds!  “It’s bonkers.”
    2. “Modern development in VS 2019.”

Load more