Archives
-
Converting a load of files from UTF-16 to UTF-8
There's a database here that I've been meaning to get into source control for a long time. Luckily we have regular backups of it (that have been restore proven) and it never changes so it's been …
-
Changing a Git branch that's tracking a remote
Having done some work against a local branch that's associated with a remote for a certain piece of work I've decided I want to keep the work (it's given me some proof-of-concept ideas) but start …
-
The anatomy of a FIX message
In my current role I've spend some time working with the FIX protocol, which is:
an electronic communications protocol initiated in 1992 for international real-time exchange of information related …
-
Using PowerShell to start and stop Hyper-V virtual machines
I've been doing a bit of VM Host upgrading recently and being able to mainpulate VMs on said hosts via the command line makes things go a lot quicker! Here's two PowerShell commands I've executed …
-
How to force Windows 10 / Server 201x to scan for updates
One of the irritations of Windows 10 and its accompanying server editions is that there's no user interface surfaced to re-scan for available updates. The ability to do this comes in handy if, say, …
-
Don't slash your globs the wrong way!
I inherited a couple of AngularJS applications that are built using gulp scripts when I started in my current role. Putting to one side the swathes of repeated code both within the build scripts …
-
Refreshing the Windows icon cache
I just updated to the latest and greatest version of Visual Studio Code, but alas my taskbar was still showing the old icon:
From this GitHub comment, here's a quick way to force the shell to …
-
Resolving: Cannot find command 'dotnet ef' and then dotnet-ef.dll isn't in the right folder?
So in my post yesterday I noted that dotnet ef wasn't present anymore and following the instructions to install it gave me a broken installation of dotnet ef.
The hack I used of copying files …
-
Cannot find command 'dotnet ef' and then dotnet-ef.dll isn't in the right folder?
There I am, on a Saturday morning trying to create an Entity Framework Core structure for an existing database, and apparently there's no dotnet ef available to me.
After running dotnet tool …
-
How to fix NUnit tests that aren't showing in Visual Studio Test Explorer
Every now and then a project I'm working on decides it's either going to not show some or (more annoyingly!) all of the NUnit unit tests that are present.
The most recent project I've seen this …
-
Getting Opserver (the awesome monitoring solution from Stack Exchange) to monitor DMZ servers
I've written about how awesome Opserver is before, but one thing I hadn't had time or opportunity for was getting the dashboard (which operates via WMI) working for servers that are sat in our DMZ. …
-
Facial Recognition using the UWP APIs in Windows 10 via Windows Forms on .NET Core 3.0
NOTE: The full code for the app built in this post is available on GitHub: https://github.com/robertwray/FacesOfUWP
In a recent post I talked about using the Microsoft.Windows.SDK.Contracts NuGet …
-
Scheduled Task that runs a PowerShell script returning 0x80070001
I've recently migrated several scheduled tasks from one machine to another as part of a rationalisation process. A couple of these tasks were ones that can only be run at a certain time, so were …
-
Using Windows 10 UWP APIs from a .NET Core application
One of the things that Microsoft talked about at Build 2019 was how they intended to broaden availability of UWP APIs so that they can be consumed by non-UWP (in the "store only / sideload only" …
-
Reading and writing a memory-mapped file in .NET Core
According to Wikipedia, a Memory-mapped file is:
A memory-mapped file is a segment of virtual memory that has been assigned a direct byte-for-byte correlation with some portion of a file or file- …
-
Updating IIS application pools using appcmd
When it comes to configuring IIS it turns out there are quite a few different ways that you can do this:
Using the Internet Information Services (IIS) Manager
Hand editing web.config and …
-
Visual Studio Team Foundation Server 2015: "TF401189: The source branch has been modified since the last merge attempt."
(Yes, I know, ancient version of TFS!)
If you're attempting to delete a stale pull request in TFS 2015 where the original branch has been deleted (or in this instance merged back to master and then …
-
Where does Certify put the certificate if you choose 'No Deployment' as the Deployment mode?
I've today (finally!) had cause to migrate a site to a Let's Encrypt SSL certificate, mainly because the incumbent provider is being somewhat useless when it comes to issuing the certificate.
We' …
-
Scaffolding an Entity Framework Core database in a project that targets .NETStandard
I've been working on a project recently for storing system configuration data (I know, I know, this is a problem that's been solved a thousand times over!) and after defining the database structure …
-
Adding a delay to ASP.NET Core Web API methods to simulate slow or erratic networks
I recently commented on a tweet by @jongalloway, saying:
A thousand times this! Run your app with an artificial delay introduced into server responses and look for things that don't make sense. …
-
Running Pi-hole on a CentOS virtual machine
Pi-hole is an awesome piece of software intended to be run on a Raspberry Pi (the clue's in the name!) that will sit quietly on your network responding to DNS requests, dropping ones for spammy …
-
'The specified URL cannot be found' - it can, but your Barracuda WAF doesn't want it to be
If you're seeing the following symptoms:
Your're seeing customers saying they're getting 'stuck' at a certain point in your application
There's nothing in your IIS (or web server of choice) to …
-
Adding logging to an old .NET 4.0 project via Castle Windsor to measure performance
Recently I've been working with a reasonably old codebase, one that's using Castle / Castle.Windsor 3.1.0 which dates back to late 2012, targeting plain .NET Framework 4.0. This has been 'interesting' …
-
Resolving 'missing' assemblies where the assembly has been renamed
We've probably all seen assembly binding redirects kicking around in config files, looking like this:
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
< …
-
Upgrading a Windows MySQL instance from 5.1 to 8.x
I've got a very old instance of MySQL kicking around (5.1.73 - released in December 2013) that's due for an upgrade. It's actually relatively newly created as it was installed using the Web …
-
Don't store monetary values as doubles
It's something that everyone should know, but apparently not...
I had an issue raised by a user recently for a piece of software that I inherited where they were being told that EUR 31,995.27 was …
-
TIL: You can use column aliases in an ORDER BY clause
This is almost certainly something a lot of other people know, but I've somehow managed to not learn it in the many (many!) years of using SQL Server that I have under my belt...
You can use the …
-
Ignoring parameters that haven't been specified in a SQL query
I answered a question on Stackoverflow today that was looking to cater for having parameters to the query that aren't always required, i.e.
The report has three parameters, Sales Id, Start Date and …