Skip to content

Instantly share code, notes, and snippets.

I may be slow to respond.

Nate McMaster natemcmaster

I may be slow to respond.
View GitHub Profile
natemcmaster /
Last active Sep 24, 2020
runtimeconfig.json schema

This defines the schema for .NET Core's runtimeconfig.json file.

Usage in an editor

Using Visual Studio, you can get auto-completion if you import the schema in your .JSON file like this:

  "$schema": ""
natemcmaster /
Last active Aug 7, 2020
Convert zip to tar.gz file
#!/usr/bin/env bash
if [[ $# < 2 ]]; then
echo "Usage: [src] [dest]"
exit 1
function realpath() {
[[ $1 = /* ]] && echo "$1" || echo "$PWD/${1#./}"
natemcmaster /
Last active Jul 2, 2020
ContentRoot, WebRoot, BaseDirectory, and CurrentDirectory

Assuming you use template defaults

public static void Main()
  var host = new WebHostBuilder()

public Startup(IHostingEnvironment env)
natemcmaster / Vagrantfile
Last active Feb 8, 2019
DNVM on Ubuntu
View Vagrantfile
Vagrant.configure(2) do |config|
# The most common configuration options are documented and commented below.
# For a complete reference, please see the online documentation at
# = "ubuntu/trusty64"
# Enable provisioning with a shell script.
config.vm.provision "shell", privileged: false, inline: <<-SHELL
sudo apt-key adv --keyserver --recv-keys 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF
View MyNuGetLogger.cs
using System.Threading.Tasks;
using McMaster.Extensions.CommandLineUtils;
using NuGet.Common;
namespace custom_restore
internal class MyNuGetLogger : LoggerBase
private IReporter _reporter;
natemcmaster /
Last active Mar 5, 2018
Design meeting notes: 2018-03-02 - Libuv and source build


In an effort to make it possible to build ASP.NET Core from source code only on a single machine without access to or already-built assets, we need to revisit the structuring of our package dependencies. The NuGet package that contains Libuv bundles binaries built on macOS, Windows, and Linux. This means it is not possible to build the package, Libuv.nupkg, from source code only -- you must have multiple machines. Furthermore, because Microsoft.AspNetCore.App depends on this package via transitive reference through Microsoft.AspNetCore.Server.Kestrel, a project restore against source-built only packages cannot succeed in offline mode.


Possible solutions

We went over ways we could solve this. This includes:

natemcmaster / dependencies.props
Last active Nov 15, 2017
ASP.NET Core 2.0.3 package versions
View dependencies.props
natemcmaster / Program.cs
Last active Aug 29, 2017
View Program.cs
using System;
using Microsoft.EntityFrameworkCore.Scaffolding.Internal;
using Microsoft.Extensions.DependencyInjection;
namespace ConsoleApplication
public class Program
public static void Main(string[] args)
View Program.cs
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Diagnostics;
namespace DotnetNames.Tool
class Program
natemcmaster / package.json
Created Oct 7, 2016
dotnet-sql-cache as NPM package
View package.json
"name": "dotnet-sql-cache",
"version": "1.0.0-preview2-final",
"bin": { "dotnet-sql-cache": "./shim.js" },
"files": [
You can’t perform that action at this time.