Software Engineering categories

Ghost Blog Upgrade to 1.* (1.8.4 in fact)

While I’ve been hapily blogging away on Ghost version 0.8.0 hosted on azure (very much ad-hoc hosting approach) the Ghost Blog team made the leap to a 1.* version, with a very breaking changes along the way, especially to their upgrade process. They’ve made it all the way to 1.8.4 and so I figured it was …

dotnet build, targeting full .Net 4.5.1 on nanoserver docker

I have been struggling to get dotnet build to work on nanoserver via docker. I had already given up on git, because I can perform git tasks outside the container first. Basically I was trying this: docker run -v "$(pwd):C:/work" -w C:/work -it --rm microsoft/dotnet:1.1.1-sdk-nanoserver powershell build.ps1 This …

Migrating onto dotnet tools 1.0.0

Since Visual Studio 2017 is out, and we have a 1.0.0 tools release for .Net Core, I’m going to try and migrate a simple project from the pre-release tooling, onto the new tooling. The biggest difference is that instead of using a project.json file, the new tooling now uses a .csproj file instead. It will take a …

Building a Windows Service with .Net Core

While we are all wanting to get onto the new hotness that is .Net Core cross platform applications, the reality is that our servers are running windows, and we use a combination of Scheduled tasks, IIS, and Windows Services to host our applications. Most .Net Core applications are console apps that work well for …

.Net Core Series - Publishing Portable Applications

This is a series on the .Net Core 1.0 bits. Looking for .Net Core 2 Series? Getting Started What’s in the box Using Multiple Projects Testing NuGet Multi-targeting Publishing Portable Applications <=(We are here) Self-contained Applications We can now take everything we have learned and start publishing our …

How to Constructors

Constructors for services are a really handy way to pass in configuration, variation and dependencies. Here are some ways I have learned to use Constructors and some ideas on testing. What shouldn’t be in a Constructor Execution. Any complex execution of code should not be in a constructor. This includes …

FiraCode, my new favorite VS Code dev font

I’ve been using Fira Code as my new dev font. And I’m sticking with it. FiraCode is available on GitHub, and is a based on the concept of ligatures, targeting at programming symbols. In short, ligatures are where two or more actual characters are printed as a single printable character, originating in print …

"failed to peek context header from STDIN" and how to fix

The docker guidance says you can run docker build piping the dockerfile: #On linux $ docker build - < Dockerfile and on Windows it says to do this: #PowerShell Get-Content Dockerfile | docker build - Nice. But I’ve been getting this error all day… > Get-Content Dockerfile | docker build - unable to …

.Net core tests not showing up in VS? Here's the trick...

I’ve been using VS Code. Great tool. But it means my tests are running through a command line runner. Essentially I use dotnet test, which is nice since I am targeting multiple platforms (.Net 4.5, 4.5.2, 4.6 & netcoreapp1.0). But when I open my test project in Visual Studio, I have 0 tests. Thats zero, none, …

dotnet + nunit3 + TeamCity success

The new .Net Core CLI has the ability to use xunit or nunit. Which is great. For running tests locally. I use TeamCity, so I like to see test results showing up, track testing count over time etc. There is a built in way to import xml reports which supports junit (which is xunit-compatible) and nunit. But choosing …

New Projects - Consolable, ConcurrentConsole & t4tinytypes

I’ve been working on some new projects, so thought I would do a quick elevator pitch for each. Consolable I was having an issue with environment variables as arguments, and with PowerShell replacing "text" with text (stripping double-quotes) and how these interacted with my command line arguments. …

.Net Core Series - Multi-targeting

This is a series on the .Net Core 1.0 bits. Looking for .Net Core 2 Series? Getting Started What’s in the box Using Multiple Projects Testing NuGet Multi-targeting <=(We are here) Publishing Portable Applications Self-contained Applications Last time we learned how to package our libraries as NuGet packages. …

.Net Core Series - NuGet

This is a series on the .Net Core 1.0 bits. Looking for .Net Core 2 Series? Getting Started What’s in the box Using Multiple Projects Testing NuGet <=(We are here) Multi-targeting Publishing Portable Applications Self-contained Applications Let’s set aside Application packing for later, and focus our …

.Net Core Series - Testing

This is a series on the .Net Core 1.0 bits. Looking for .Net Core 2 Series? Getting Started What’s in the box Using Multiple Projects Testing <=(We are here) NuGet Multi-targeting Publishing Portable Applications Self-contained Applications We want to be able to test our application code that we build. …

Experimenting with global.json

While working on my .Net Core Series I noticed that Visual Studio was adding a global.json file to the root of my project, and liked to put src and test in there. I thought I would investigate what it actually does. I noticed that if all my project folders were next to each other it didn’t matter. So here is my …

.Net Core Series - Using Multiple Projects

This is a series on the .Net Core 1.0 bits. Looking for .Net Core 2 Series? Getting Started What’s in the box Using Multiple Projects <=(We are here) Testing NuGet Multi-targeting Publishing Portable Applications Self-contained Applications We know how to create new projects, we know how to build and run our …

.Net Core Series - What's in the box

This is a series on the .Net Core 1.0 bits. Looking for .Net Core 2 Series? Getting Started What’s in the box <=(We are here) Using Multiple Projects Testing NuGet Multi-targeting Publishing Portable Applications Self-contained Applications Last time we created a new application. Once with dotnet CLI and once …

Visual Studio Code with C# and dotnet

Getting Started with Visual Studio Code? Me too. Let’s see what it takes to get going. This is a bit of a companion piece alongside my .Net Core Series I am writing at the moment. Hopefully as well as .Net Core, I will have a play with writing TypeScript, Rust and maybe C++ inside Visual Studio Code. I might have …

.Net Core Series - Getting Started

This is a series on the .Net Core 1.0 bits. Looking for .Net Core 2 Series? Getting Started <=(We are here) What’s in the box Using Multiple Projects Testing NuGet Multi-targeting Publishing Portable Applications Self-contained Applications We finally got some finalised bits in a release this week. So here is …

Form posts with PowerShell

This article is based on an answer found and updated on StackOverflow. I’f you have used PowerShell for much at all, you are probably familiar with Invoke-WebRequest. But did you know you can carry around a session and have it automatically add and update cookies for you? The Scenario I had an API I wanted to …