UPDATE Oct 2019: 2FA causes significant problems
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.
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
Generally, the Android emulator for Windows ran on Intel’s HAXM hypervisor. Unfortunately HAXM runs in the same way as Microsofts Hyper-V, and both cannot be enabled at once. While some users get away without using Virtual Machines (I’m one), many prefer the separation VM’s afford, and there’s no way they’ll ditch Hyper-V capabilities (if that’s the hypervisor they’re using…). The hardest hit would have to be the Docker users though, as Docker runs it’s VM’s on Hyper-V (Mine is at least).
Android
recently updated their Android Emulator to support Hyper-V AND HAXM, which is great for us! It should be noted that they still tout HAXM as the preferred method, as it’s “more performant”.
Xamarin Forms should be an easy sell.
But there’s a shadow that hangs over Xamarin, one shared by most mobile dev platforms: FIDDLINESS.
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.
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:
services.AddHostedServices<SOME_BACKGROUND_SERVICE>
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)
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.
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
snyk test
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”
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:
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.
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 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.
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:
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?
Hugo Shortcode Syntax Highlighter VSCode extension is live!
More improvements in April 2024
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.
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.
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 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.
AV1 on FFMpeg isn’t so bad now!
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.
.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…
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…
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.
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 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.
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…
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!
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!
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?
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.
Previously on
Blazor: Good and Bad I played with Blazor and made a toy app to test things out.
I came to the conclusion that some was good, some was bad, time will tell.
Now that I’ve come back to it with a much more complex app, my opinion hasn’t really changed, but I did have a go at more complex state management.
CosmosDB partition keys got me and
some others
on Stackoverflow, so I’m gonna drop a short one here.
Also, getting Azurite to run when the project is launched in VS.
I wanted to use the Azure App Service console to install some software to test which needed NodeJS.
The default Node version is 0.10.1
…
Can I provide a fully powered IDE experience to users without external requirements?
I figured there must be something like the Github .
experience that I could use.
Apparently I was wrong.
I’ve been playing with
Obsidian over the last few months, and aside from some minor UI changes (via CSS) it’s been pretty good!
However, I found that I wanted to see what I was up to last week in the context of what I’m doing today.
Here’s how I did it.
I have a Xamarin Forms app that needs to send location info (for example a shopping center assistant app) to the server every 5 seconds, but I know that the user will likely be using some other app during this time, so my app will be in the background. How can I make that happen?
In my spelunking with Android Foreground Services, I needed to do debugging, and since I’m in Xamarin Forms, I used built in Visual Studio tools.
Swagger is a useful tool to describe your API and how it behaves.
OpenAPI is the standard which describes what tools like Swagger should expose.
I wanted my Azure Function to show an example
on my properties, something the spec indicates is allowed, but I could not do it easily with the dotnet tools ☹️
EDIT: May 2023. I’m admitting defeat here. I got to the point where I was pulling the docker images and editing them to work locally and I realised it’s just ridiculous.
I’m frustrated it’s this difficult.
Still, I also realised that I wanted an offsite backup anyway, so
here’s the new plan.
A few times during debugging sessions, some of my colleagues have brought up this fairly cool looking notes app.
It turns out to be far more than a notes app, and is in fact, an entire personal cloud called
Nextcloud.
While it looked and felt cool (my own cloud!!), I wasn’t sure I’d really make use of it, so before purchasing anything, I figured I’d set it up locally.
This took longer than I expected.
After admitting defeat on my previous post attempting to get Nextcloud running locally (and remembering that I wanted an offsite backup anyway), I’ve bought a VPS and installed Nextcloud on it.
In the past, I’ve played with MAUI in toy projects but recently I decided to try and upgrade a Xamarin Forms app to MAUI.
That went poorly with the
Upgrade Assistant so I started with a fresh project and migrated across.
Here’s a few tips and tricks and common patterns for a MAUI app that I found useful.
This took me too long to figure out NOT to write a blog post about it 🥲
I’ve tried almost all the major git clients out there, and these two are the main ones that stuck with me.
Tower and Sourcetree just didn’t jive with me, Git Extensions…I really hated, even VSCode and Visual Studio git are fine in a pinch.
I started with Gitkraken, moved to Fork because it was cheaper and I wanted to try something new, so after a year, how do they compare?
Recently, I’ve been investigating some poor memory behaviour in an Azure App Service and had the usual niggle to dig into performance again.
This time, it’s about serialisation performance, specifically regarding memory allocations.
Many of the Aspnetcore auth samples and tutorials discuss using multiple authentication schemes, but I ran into an interesting issue that I found interesting.
It’s also obvious in retrospect 😭
In short: I had multiple schemes working fine, but the default scheme always ran (even though it failed) and logged failure messages.
Why?
You’re starting a new app, which cross platform mobile framework should you choose?
You’ve had Cordova apps, and they made you sad, you’ve heard “why not native?”, and decided that’s not viable (for your own reasons), so what to do?
Well I built a similar toy app in a few of the big frameworks to compare them extremely subjectively (with some objectivity sprinkled in)
Honestly, I still don’t know which of them I like best.
A while back, I started playing with
Nextcloud and wrote a bit
about it noting that I wondered if I’d use it.
Well I haven’t really, but as many have mentioned to me, the whole self-hosting thing is addictive!
So…I’ve been playing with
Jellyfin,
Plausible, and
VSCode/Coder but I keep forgetting how to set them up.
So far, they’ve all been similar in their configuration and setup with my existing reverse proxy
Apache2.
I’m going to quickly document the setup here for future reference.
I recently setup a new Windows laptop and immediately ran across some issues or things I don’t think should be default.
Databases are magic black boxes that we developers use all the time, but rarely really understand.
Sure, we could understand them, but:
So what can we mere lazy mortals do when SQL Server databases misbehave?
Docker has become a widely used tool in the industry, but I keep forgetting how to do even it’s most simple commands.
Google is sufficient for those, however there’s a few things I want to write down for my future self.
I feel like the world is getting more and more hectic.
You have to sign up to everything (who then send you emails), there’s an app for everything too (which ping you at every opportunity) and more and more, I find my attention fragmented.
Here’s some methods/ideas/ramblings that you’ve definitely heard before that I’m trying to use to keep my focus, prevent context switching, and keep myself productive.
While running apps in containers with the likes of Docker and Podman, the cloud can add additional complexity to this.
This is particularly relevant when control of the container environment is not in your hands.
This is a little story about debugging a container issue in AWS and some of the interesting things I learned out of it.