Skip to content

Instantly share code, notes, and snippets.

View natemcmaster's full-sized avatar

Nate McMaster natemcmaster

View GitHub Profile
@natemcmaster
natemcmaster / package.json
Created October 7, 2016 00:51
dotnet-sql-cache as NPM package
{
"name": "dotnet-sql-cache",
"version": "1.0.0-preview2-final",
"bin": { "dotnet-sql-cache": "./shim.js" },
"files": [
"shim.js",
"**/*.dll",
"*.runtimeconfig.json",
"*.deps.json",
"runtimes/**/*"
@natemcmaster
natemcmaster / Program.cs
Last active September 1, 2016 19:36
Which file attributes?
using System;
using System.IO;
class Program
{
static void Main(string[] args)
{
foreach (var file in args)
{
var attributes = new FileInfo(file).Attributes;
@natemcmaster
natemcmaster / README.md
Created September 1, 2016 18:58
Echo command line args

Compile in Developer Command Prompt for VS 2015

PS> cl echo.c 
@natemcmaster
natemcmaster / README.md
Last active July 8, 2016 15:32
ALC versions

Consider this following example:

An implementation of ALC is setup to load CommonAssembly, Version=2.0.0.0, InformationalVersion=2.0.0-beta.

The host in an app that this on the TPA: CommonAssembly, Version=2.0.0.0, InformationalVersion = 2.0.0-alpha.

// in a test app that depends on CommonAssembly "2.0.0-alpha"
public class HostProgram
{
@natemcmaster
natemcmaster / clear-nuget.cmd
Last active June 22, 2016 18:32
Clear NuGet
REM npm i -g rimraf
REM https://github.com/isaacs/rimraf
rimraf %USERPROFILE%\.nuget\ %LOCALAPPDATA%\NuGet\v3-cache\ %LOCALAPPDATA%\NuGet\Cache\
@natemcmaster
natemcmaster / README.md
Created June 18, 2016 22:55
ASP.NET Core Directories

Development-time

src/
  Web/  <-- Microsoft.AspNetCore.Hosting.IHostingEnvironment.ContentRootPath, System.IO.Directory.GetCurrentDirectory()

    project.json
    web.config
    
    wwwroot/ <--  Microsoft.AspNetCore.Hosting.IHostingEnvironment.WebRootPath
 app.js
@natemcmaster
natemcmaster / Program.cs
Created June 18, 2016 19:00
Saving/reading guid as string
using System;
using Microsoft.Data.Sqlite;
using static System.Console;
namespace ConsoleApplication
{
public class Program
{
public static void Main(string[] args)
{
@natemcmaster
natemcmaster / preview_vnext.md
Last active June 1, 2016 00:33
EF design time tools

How EF design-time tooling will work

Package structure

Microsoft.EntityFrameworkCore.Tools
├── lib
│   ├── netcoreapp1.0
│   |   └── dotnet-ef.dll
|   ├── net451

Preview 1: How EF design-time tooling works

Package structure

Microsoft.EntityFrameworkCore.Tools
├── lib
│   ├── net451
│   │   └── Microsoft.EntityFrameworkCore.Tools.dll <-- PowerShell OperationExecutor is here
@natemcmaster
natemcmaster / runtime.json
Created May 19, 2016 07:04
Microsoft.NETCore.Platforms
{
"runtimes": {
"base": {},
"any": {
"#import": ["base"]
},
"win": {
"#import": ["any"]