Building iOS store certificates on Windows

UPDATE Oct 2019: 2FA breaks things :(

How many times have you been working on a cross platform app and been ready to submit to the app stores, but then the Apple store needs a .csr that you should “use a Mac” to generate?

When I google this, I got lots of complicated methods using IIS to request certificates through a quite frankly terrible UI/UX, and most of the guides glossed over how to actually get that .p12 at the end you needed.

Incorporating .NET Core 2.1 into existing .NET Framework/UWP applications

EDIT: As a colleague pointed out, the method below could potentially cause errors at runtime if the .NET Core 2.1 runtime is not installed.

The recently announced .NET Core 2.1 brings some nice new features, but the big draw is the support of Span and it’s performance happy friends.

Adventures in Xamarin Forms

Issues getting started, and differences to WPF/UWP

Xamarin Forms should be an easy sell.

  • Work in C# and XAML. Two good (XAML…?) and well defined languages
  • Works across major mobile OS’s
  • Even works for UWP, enabling a desktop experience if desired

But there’s a shadow that hangs over Xamarin, one shared by most mobile dev platforms: FIDDLINESS.

Software Testing

Testing is an oft argued topic, as I discovered when I started at Readify.
As a bit of a testing noob, I’d only read a bit about testing and thought “That sounds useful, more things caught before deployment”, but upon trying to write them, I found it hard to come up with sensible scenarios. Many of the tutorials I’d seen were around calculations which just aren’t a part of my job in any way.

ASP.NET Core Background Service

Background tasks are often delegated to worker projects or external libraries to be handled, but ASP.NET Core has something like this inbuilt.
The actual interface is IHostedService and is registered in startup.cs like:

Expand/Collapse csharp

services.AddHostedServices<SOME_BACKGROUND_SERVICE>
services.AddHostedServices<SOME_BACKGROUND_SERVICE>

Mailkit ASP.NET Core

Mailkit is the new official replacement for the SMTPClient as indicated here. There are much better tutorials than anything I can write right now, but here’s a quick primer (there’s also a good tutorial in the Readme for Mailkit)

Issues with Android Emulator DNS

The Android Emulator is pretty sweet now. Fairly performant, works with Hyper-V still enabled, etc.
Recently I started having an issue where the emulator wouldn’t get it’s network set up properly. My adapter list looks pretty crazy (15 or so adapters), so maybe it’s getting confused? Anyway, seems to be an issue that others have come across as well, because I found a few StackOverflow issues about it.

Adding Snyk to VSTS

Snyk is an open source tool for checking project packages for vulnerabilities. It currently checks the main package sources like npm and Nuget. While it has many integrations with source control (github, bitbucket, etc), there’s no VSTS build pipeline integration yet.
As such, I’ve gone and used the API instead! It was fairly straightforward to set up, which is good for the safety of our clients.

tl;dr

  • Setup Snyk account and get API key
  • Setup pipeline with SNYK_TOKEN (api key)
  • Have task to install Snyk and run snyk test

Forcing any version of Xcode on VSTS Mac build agent

Developers using the Apple Store might have recently noticed a message indiciating that “This app has been built for iOS 11.x. Starting March 2019, all apps will be required to target iOS 12.1 available in Xcode 10.1”

Using Service Connections in Azure DevOps

I was recently setting up a build pipeline in Azure DevOps and realised I didn’t have access to the Azure resources to be able to pick the app service as a deployment target.
The easy way would be to get my account access to the Azure resources, but:

  1. I’d be the only one with the ability to change those deployment options, or at least new devs would to get access as well before they could.
  2. The onsite guy for that kind of access was away.

VSCode Extension: Hugo syntax highlighting for Markdown

Some time ago, just after the first post on this blog, I started using Hugo Shortcodes.
The theme I was (still am) using didn’t have great support for some of the markdown stylings that I wanted, and instead of fiddling with that, I figured I’d create my own with custom styles and Hugo Shortcodes.

Angular Transclusion With Parameters

I recently came across a scenario where I had several components with the same structure in them, so I figured I’d extract it out into it’s own component.
Simple right? Everyday scenario?
Were it so easy…

Service Worker Updates

Service workers are the new hotness when it comes to web applications.
They allow a website to have some offline behaviours similar to that of an app, including an “installable” desktop experience.
In essence, they’re a small app that browsers can interpret and run, caching info and queueing requests, enabling offline access and data-saving.

Visual Studio and VS Code Tips and Tricks

A colleague mentioned they weren’t aware of Logpoints in Visual Studio, so here’s some things that aren’t on or known about by default (usually because they’re experimental or stylistic)

Some that I’ve found useful:

  • Logpoints
  • Cursor animations
  • Semantic highlighting
  • Parallel stacks
  • Output window filters
  • Unreferenced assembly Intellisense

Node as a Dependency

Managing node versions can become painful when switching between projects.
There’s a mechanism to check node versions during an npm install called Engines, but that doesn’t help if the projects are installed already.
The fix is to install node as a dependency. Who would have thought?

Casting NaN to Numerics

I came across an interesting problem today where a cast from double to int resulted in int.MinValue. Further digging revealed that it was a NaN problem. How did I get a NaN in simple C#? Damn divide by zero, that’s how. But wait, how did I not get an exception? I had: Expand/Collapse c# double first = 0; double second = 0; var result = (int)Math.Round(first / second); double first = 0; double second = 0; var result = (int)Math.

Hugo Syntax Extension: Revisited

Hugo Shortcode Syntax Highlighter VSCode extension is live!

Migrating to dotnetcore 3.1 (mostly EFCore)

Dotnetcore 3 has been out for a little while now, and there were some changes I wanted in the project I was working on, so off I went and gave it a burl.
Needless to say, there were some issues, but in fairness, some of it was our fault.

C# - Static members in Generic classes are weird

Generic classes are useful coding constructs that I thought I mostly understood, but I had an issue with them recently that blew my mind… Static members in Generic classes don’t work as I naively expected.

HTML 5 Video and Images for Web

I like being efficient with my bits and bytes. I bought into the webp image format train pretty early, adopting it when I made this blog.
Recently I made a video longer than 2 seconds, so I started looking properly into codecs like VP9 and AV1.
Lets take a look into some video and image codecs and how the new shiny ones can be used.

Nancy + Castle + .NET 4.7 to dotnetcore

Nancy was deprecated earlier this year, so I decided to do a full upgrade of a codebase from .NET 4.7 to dotnetcore 3.1.
It’s been a loooong journey…Nancy and Castle have been interesting to migrate away from.

Revisiting Av1

AV1 on FFMpeg isn’t so bad now!

SQL Performance Chasing

We’re moving a client to Azure from on premises and there were some performance hurdles.
They weren’t unexpected, and nearly all of them were database related.

Playing with Blazor in .NET 5

.NET 5 was released recently, with boatloads of goodies.
Blazor got some attention in this release, and I had some free time to play with it.
There’s good news and bad news…

Azure and The Performance Mystery

Semi-recently, we moved a client from On Premises to Azure with the promise that it’d be better.
While generally true, lately we’ve been getting reports of performance issues…

Caching MediatR Queries

Previously, I did some performance investigations in Azure. The cause remains elusive, so I’ve started looking into caching, most interestingly caching Mediatr Query results.

Migrating Newtonsoft to System.Text.Json

System.Text.Json was released with dotnetcore 3 in 2019, and has been improved in NET 5.
After recently upgrading this project to dotnetcore 5 (which was much easier than the linked upgrade to dotnetcore 3…), I was curious to see what the migration path looked like for a real project.

Some Useful Blender Tips

Some Blender tips and tricks that I’ve built up over my short time, so saving them here so I don’t forget them :D
This will keep being updated as I think of them.

Dockerising a Full Stack (SQL, aspnetcore, React) application with a nice F5 experience

I work in Managed Services, and we end up with a lot of projects on different versions of things (node, packages, dotnet, etc)
So I want to get a full stack project with good F5 debugging experience and easy onboarding that can run without those dependencies!
I succeeded! Kinda…

Upgrading .NET 4.8 to NET 6: Aspnetcore Auth + Background Service

I recently upgraded a project from NET 4.8 to NET 6, and the most interesting parts were Autofac to MS DI, Auth, and the Windows Service.
It went fairly well!

Android Emulator: Connecting to Localhost

I often use the Android Emulator to do testing on a Xamarin Forms app, or Cordova, or something of the sort.
It’s a long round trip to point at test when you want to debug the backend behaviour, so let’s point it at local dev!

Managed Services Handovers: the Good, the Bad, and the rest

I work in Managed Services, and we often get handover from the Professional Services when they roll off a project.
What makes a good handover to Managed Services/Sustained Engineering?
What do we want? What makes us sad?

What I Use

I recently mentioned Win + V in some internal channels and people are always surprised it exists.
So, here’s a list of things, both tools and basic tips, from what I think is most useful descending.