A collection of 34 posts


Copy all repositories from Github enterprise

We are finally finishing the migration of GitHub Enterprise to TFS. While doing so, we wanted to programmatically make sure we had all of the source code off of our old Github server. Including those that belonged to individual users, including those that had left. Unfortunately Github doesn't make a utility for this. So I set out to do it on my own. Since we are Windows shop and I'm wanting to get my PowerShell skills better, I set out to do it in PowerShell. The trick was getting the list of


Octopus, TFS and Blue Green Deployments

Ok, so lets start this off with a little background of where we came from and where we wanted to get. Our current environment consisted of a development environment with a single server on the same domain as the deployment server. And a production environment at a 3rd party hosted environment not on the same domain with no direct connectivity to the build/deployment server. We used GitHub Enterprise on-premise for source control and TeamCity for continuous integration and deployments. Productio


node/npm/gulp/continuous integration

Alright, so I have continue integration for my new dotnet core applications. Building works great. It's now time to publish. I'm using gulp on my pre-publish commands to move files, compile typescripts, minify css/javascripts, etc. It works fine for my user after running npm install gulp -g. But, because I want all of my publish and builds to be self contained, and it also doesn't work when running under my build user spitting out an error saying Error : 'gulp' is not recognized as an internal o


Web Based Password Generator

Ok, so this is kind of a little thing I did. I wanted a page that would generate a password without anything done on the server side. I wanted it all to be done on the client. I also wanted the ability to exclude certain characters, but yet allow others of a category. For example, one of our old legacy systems doesn't handle quote's very well, so I want to exclude quotes from the generated passwords. So, I set out to create one. It's done entirely in javascript with no server post back (for the


Custom model validation in ASPNET Core

I just wanted to post how to do custom model validation. It took me a few hours and it wasn't posted anywhere yet. So, I wanted to do my own model validation so I can call ModelState.IsValid and get whether the posted model was valid or not. I needed some custom code. In my case it was to make sure that only 1 of 2 boolean properties were set to true. After digging through the sources I found an easy way. Implement the System.ComponentModel.DataAnnotations.IValidatableObject interface. The def


ASP.NET vNext Custom Authentication

Welcome all, here's my delima. I need to be able to implement my own custom Authentication middleware in vNext. I needed to do this because of a requirement where I cannot use cookies. Reason being is that my site will be iFramed into another application. I know, its not a good solution, but it is what it is. There was little to no documentation on how to implement your own authentication middleware so I set out on a journey. It's relatively easy to set it up and get it going. Now, this is not f


VSO Build and File Select/Exclude

Hey all, so today I wanted to use the new (finally) feature of pushing nuget packages to nuget feeds inside of Visual Studio Online's build environment. Which is turning out to be really awesome by the way. Anyways, I'm doing a vNext project and it creates 2 nuget packages *.nupkg. I create a new Nuget Publish task and it set the default. First, it won't work correctly, it'll try and upload some downloaded nuget packages. Lame. So we need to change the default of **\*.nupkg to **\artifacts\**\*


From Nuget.Server to NugetGallery

Well, we started running into an issue with Nuget.Server and it was time to migrate to NugetGallery. Mainly, it wouldn't clean itself up (after a few days, there were 10's of gigs of temp files in c:\windows\temp\nuget), and now that we have a couple thousand packages it started really slowing down. It was just time. So here goes what I did to make this work. Initial Steps: 1. Clone NugetGallery from github 2. Configure NugetGallery settings (database, etc) 3. Modify the web.config in the N


ASP 5 vNext WebAPI Abstract/Inherited Classes

Good evening everyone, I've been fighting vNext, Web API and abstract classes. I just want to be able to pass an array into my API of a bunch of different types that all inherit a base class. Turns out it's a configuration option as vNext uses Newtonsoft.JSON to do the serialize/deserialize it was just a matter of finding it. Here's an example what I want passed into my API. public abstract class FilterBase { } public class Filter1 : FilterBase { public string FilterString { get; set; } }

Windows 10

Windows 10 - .NET 3.5

Ok, so here's the overall situation 1. Fresh Windows 10 Install 2. Installed IIS attempting to include .net 3.5 in this install - it failed pulling the package from Windows Update due to my WSUS server. 1_ Skipped the .net 3.5 and installed everything. IIS, .net 4.5, Hyper-V etc. 3. After fixing my Group Policy to pull from Windows Update I attempted to install .net 3.5 at which point I started getting a 0x800F081F during the install(among others). The fix. Uninstall IIS


Team City, MSBuild, MSDeploy, Web Deploy, NTLM and aspnet_client

Ok, more on Team City and build/deploy stuff. In my previous blog post, I showed how to run team city as a domain user account. One of the reasons was for web deploy to not store the username/password in the configuration. There's another gotcha with web deploy I'll help you fix as well, when deploying to the root of a site, there is a cool folder that the updates to .net framework insists on creating. And it doesn't inherit the permissions either. It's aspnet_client. It's a pain. Because it bre


Teamcity HTTPS running under a service account

Well, now that I'm in my devops role, it's time for me to start working on our Team City build environment. One of the things we wanted to do, now that we have the time, was run our Team City environment under a service account and force https. It's part of company wide thing to enable and force https on everything, and I prefer service accounts and windows authentication for service accounts. It makes communicating with network resources really easy.....web deploy (another post) for example. B


Certificate information and Fiddler

So, one of my biggest gripes with fiddler is not being able to see what the original ssl cert the server was spitting out was. If you decrypt the ssl traffic, fiddler acts like a man-in-the middle and replaces the server certificate with it's own so it can decrypt it. If you don't understand that very well, google will help alot more than I can. So. Long story short, I needed to know what ssl certificate the web servers were spitting up, even if Fiddler was running. Fiddler doesn't have this


Enhanced security in web sites (headers)

Hey all, so, just got back from a pretty good "Secure Coding" conference from SANS. Learned a lot of stuff. Including some simple countermeasure you can implement on you site. Not all browsers support them, but, with them, it helps prevent Cross Site Scripting. I have create a little .net library that will help with implementing them, along with a sample web app. I encourage you all to go look at it at: It's really easy to use. Hopefully you a


IE8 and checking to see if an element is being hovered

Hey there, last night I needed to figure out why a jquery selector wasn't working in IE8. :hover. Turns out IE8 doesn't support the hover css selector. Lame. Unfortunately I still have to support IE8, its a good portion of the users of my site. So, I came up with a quick workaround. It effectively just tracks whether the mouse is in the element or not. Now, this could be modified to be supported on multiple elements, but I only needed one so I hacked it together real quick. And it should get you


Create content type in Umbraco

Hi, this is one of my first posts on programming in Umbraco. And it's about programatically creating a content type and assigning the available child content types. It's actually pretty easy once you spend a day digging through code, so I figured I would share my knowledge. To create the content type is pretty straight forward. First, all of the using statements needed for this exercise. using System.Collections.Generic; using System.Linq; using umbraco.interfaces; using Umbraco.Core.Models;


WCF and external .config file

Hi all, it's been awhile. I've been pretty busy. Anyways, I just had a requirement, due to limitations of the software I'm working with, to load WCF configuration I had to do it from a file other than the web.config. I started out thinking this was going to be an easy task, wrong! Took a day of plugging away, but I finally found it. My requirements were, load config from external file and be able to use the standard WCF config sections. There are 3 main steps to this. Load the external config



OK, this is really, really annoying. You should NOT have to do any config to support the 2 most widely used protocols on the internet, HTTP and HTTPS. Here's the simple, really simple, web.config to support both HTTP and HTTPS. You don't need all the attributes to do it, if you don't specify them, it will use the defaults. So, for simplicity sake, I didn't put them in. This is an example that I couldn't find on here you all go. <system.serviceModel> <bindings> <basicHtt