Skip to content

Instantly share code, notes, and snippets.

View asklar's full-sized avatar

Alexander Sklar asklar

View GitHub Profile
@asklar
asklar / winget_sandbox.md
Last active December 7, 2022 04:13
Install WinGet on Sandbox

Sandbox doesn't have the store so you can't install Package Manager through the store You need to download the WinGet msix, but that has a dependency on VCLibs which is also not present in Sandbox.

If you search for VCLibs you get to this download center page: Download Microsoft Visual C++ UWP Desktop Runtime Package

But the link to install the VCLibs package is broken (I hope to have them fix it) so instead you have to download it from this other page: C++ Runtime framework packages for Desktop Bridge

@asklar
asklar / msbuild-binlog.md
Created April 19, 2022 18:11
Collecting an msbuild binlog
  1. Install the Project System vsix in Visual Studio: open the Extensions menu -> Manage Extensions image

  2. Restart VS and open the build logging window image

  3. Clean the project, turn on recording in the build logging window, and build the project image

  4. You'll see a trace in the Build logging window. You can right click -> open external to open the trace in the binlog viewer.

@asklar
asklar / UI-Frameworks.md
Last active August 8, 2022 08:55
Microsoft UI framework glossary

Here's a non-exhaustive list of Microsoft UI frameworks in alphabetical order

Adaptive Cards

A cross-platform framework for lightweight UI and data exchange, with multiple renderers (web, iOS, Android, React Native, UWP XAML). https://adaptivecards.io/

Fluent UI

A library for creating apps and websites using the Fluent design languages.

Name Endpoint Renders to
@asklar
asklar / Notifications.h
Created May 29, 2021 22:36
React Native for Windows native module for raising Toast notifications
#pragma once
#include <NativeModules.h>
#include <winrt/Windows.UI.Notifications.h>
#include <winrt/Windows.Data.Xml.Dom.h>
using namespace winrt::Windows::UI::Notifications;
using namespace winrt::Windows::Data::Xml::Dom;
REACT_MODULE(Notifications)
@asklar
asklar / follydeps.md
Last active April 8, 2021 00:05
Folly usage in React Native and React Native for Windows

Limiting RN dependencies

Usage in React Native Windows

Today React Native Windows depends on RN core, which uses Folly and a number of other libraries (double-conversion, glog, sys).

Some [parts] of these libraries don’t work in UWP context (e.g. calling CreateFile on arbitrary paths).

We don’t build all of Folly, instead we carve out the minimum set of files that we need (and work in UWP).

Every time we take a new drop of Folly, we are opened up to new dependencies of Folly being introduced (e.g. double-conversion, fmt). These are dependencies of Folly but not used by RN or RNW. However, they are needed to build Folly.

@asklar
asklar / TestWinRTBoxing.cpp
Created March 29, 2021 19:02
Test WinRT boxing/unboxing
#include "pch.h"
#include <iostream>
#include <winrt/Windows.Devices.Input.h>
#include <winrt/Windows.UI.Xaml.h>
using namespace winrt;
using namespace winrt::Windows::Foundation;
using namespace winrt::Windows::UI::Xaml;
void printType(const IInspectable& ii) {
@asklar
asklar / .vsconfig
Created September 17, 2020 18:58
vsconfig for RNW
{
"version": "1.0",
"components": [
"Microsoft.VisualStudio.Component.CoreEditor",
"Microsoft.VisualStudio.Workload.CoreEditor",
"Microsoft.NetCore.Component.Runtime.3.1",
"Microsoft.NetCore.Component.SDK",
"Microsoft.VisualStudio.Component.NuGet",
"Microsoft.Net.Component.4.6.1.TargetingPack",
"Microsoft.VisualStudio.Component.Roslyn.Compiler",
@asklar
asklar / JustMyXaml.ps1
Created June 1, 2020 08:44
Enables or disables VS2019 "Just my XAML" feature programmatically
# This script enables or disables VS 2019's JustMyXaml feature
[CmdletBinding()]
param([bool]$Enable)
if (!([bool](([System.Security.Principal.WindowsIdentity]::GetCurrent()).groups -match "S-1-5-32-544"))) {
throw "Please run this script elevated";
}
$instanceId = & "$(${env:ProgramFiles(x86)})\Microsoft Visual Studio\Installer\vswhere.exe" -property instanceId
$hiveFile = "$($env:LocalAppData)\Microsoft\VisualStudio\16.0_$instanceId\privateregistry.bin"
@asklar
asklar / Preprocess.targets
Created May 19, 2020 03:01
Preprocess C++ to file
<?xml version="1.0" encoding="utf-8"?>
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Target Name="Preprocess">
<Message Condition="'$(Source)'!=''" Text="Preprocessing: $(Source)"/>
<Error Condition="'$(Source)'==''" Text="To generate a pre-processed file, please specify a source file with msbuild /p:Source=nameOfTheSource.cpp"/>
<CL PreprocessToFile="true" Sources="$(Source)"
AdditionalIncludeDirectories="%(ClCompile.AdditionalIncludeDirectories)"
PreprocessorDefinitions="%(ClCompile.PreprocessorDefinitions)"
AdditionalOptions="%(ClCompile.AdditionalOptions) /d1PP"
PreprocessKeepComments="true"