Skip to content

Instantly share code, notes, and snippets.

View SimonCropp's full-sized avatar

Simon Cropp SimonCropp

View GitHub Profile
# Result Protocol Host URL Body Caching Content-Type Process Comments Custom
1 200 HTTP Tunnel to api.nuget.org:443 0 devenv:18084
2 200 HTTP Tunnel to api.nuget.org:443 0 devenv:18084
3 200 HTTP Tunnel to api.nuget.org:443 0 devenv:18084
4 200 HTTP Tunnel to api.nuget.org:443 0 devenv:18084
5 200 HTTP Tunnel to api.nuget.org:443 0 devenv:18084
6 200 HTTP Tunnel to api.nuget.org:443 0 devenv:18084
7 200 HTTP Tunnel to api.nuget.org:443 0 devenv:18084
8 200 HTTP Tunnel to api.nuget.org:443 0 devenv:18084
9 200 HTTP Tunnel to api.nuget.org:443 0 devenv:18084
@SimonCropp
SimonCropp / foo.cs
Created April 5, 2018 06:04
generate script for sql server db
using System.Collections.Generic;
using System.Data.SqlClient;
using System.Linq;
using Microsoft.SqlServer.Management.Common;
using Microsoft.SqlServer.Management.Smo;
//using Microsoft.SqlServer.SqlManagementObjects package
public static class SqlScriptBuiler
{
public static string BuildScript(SqlConnection sqlConnection)
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
<Version>2.0</Version>
<Version Condition="'$(BUILD_BUILDID)' != ''">$(Version).$(BUILD_BUILDID)</Version>
</PropertyGroup>
<Target Name="UpdateTFSBuildNumber" BeforeTargets="Build">
<Message Text="##vso[build.updatebuildnumber]$(Version)" Importance="high" />
</Target>
</Project>
exec sp_msforeachtable 'alter table ? nocheck constraint all'
declare @tbl nvarchar(250);
declare i cursor local fast_forward for
select '[' + table_schema + '].[' + table_name + ']'
from information_schema.tables
where table_type = 'base table' and table_name != 'sysdiagrams'
open i;
http://www.catalog.update.microsoft.com/Search.aspx?q=KB4054517
expand -F:* windows10.0-kb4054517-x64_f1c0e8eae96b357bc13e5668c5874904502106df.msu C:\Temp\kb4054517\
start /w %SystemRoot%\system32\pkgmgr.exe /ip /m:C:\temp\kb4054517\Windows10.0-KB4054517-x64.cab
@SimonCropp
SimonCropp / gist:845dd9e633651f3389dc950856a9eb61
Created February 14, 2017 22:36
please change json.net version
Attempting to gather dependency information for package 'Newtonsoft.Json.9.0.1' with respect to project 'Server.New', targeting '.NETFramework,Version=v4.6.1'
GET https://api.nuget.org/v3/registration1-gz/newtonsoft.json/index.json
OK https://api.nuget.org/v3/registration1-gz/newtonsoft.json/index.json 29317ms
GET https://api.nuget.org/v3/registration1-gz/nservicebus.persistence.sql/index.json
GET https://api.nuget.org/v3/registration1-gz/nservicebus/index.json
GET https://api.nuget.org/v3/registration1-gz/nservicebus.persistence.sql.msbuild/index.json
GET https://www.myget.org/F/particular/FindPackagesById()?id='NServiceBus'
GET https://www.myget.org/F/particular/FindPackagesById()?id='NServiceBus.Persistence.Sql.MsBuild'
using System;
using System.Linq;
using Mono.Cecil;
using Mono.Cecil.Cil;
public static class MissingTaskUsage
{
public static void CheckForMissingTaskUsage(string assemblyPath)
{
@SimonCropp
SimonCropp / gist:04c6b3b91eeab70ba9ad
Created December 8, 2015 05:02
slack command line
"C:\Users\simon\AppData\Local\slack\app-1.2.7\slack.exe" --type=renderer --no-sandbox --lang=en-GB --app-user-model-id=com.squirrel.slack.slack --node-integration=false --preload="C:\Users\simon\AppData\Local\slack\app-1.2.7\resources\app.asar\static\ssb-interop.js" --enable-pinch --device-scale-factor=1.3541666269302368 --enable-delegated-renderer --num-raster-threads=4 --enable-gpu-rasterization --gpu-rasterization-msaa-sample-count=8 --content-image-texture-target=3553 --video-image-texture-target=3553 --channel="38076.5.657713118\441570079" /prefetch:673131151
PM> Install-Package NServiceBus -Version 4.7.6
Install-Package : Unable to find version '4.7.6' of package 'NServiceBus'.
At line:1 char:2
+ Install-Package NServiceBus -Version 4.7.6
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [Install-Package], InvalidOperatio
nException
+ FullyQualifiedErrorId : NuGetCmdletUnhandledException,NuGet.PowerShell.Comma
nds.InstallPackageCommand

Nuget package dependency resolution is broken by design. It incorrectly with resolve the oldest dependency listed, no matter how many bugs have been fixed in more recent versions. So please remember to do a nuget update to check if any newer versions of dependencies are available. The recommended approach is to update to the Highest Minor