Programming

Blog, Programming

Blazor: OnInitializedAsync Null Exceptions

One of the first issues I encountered when building data-driven Blazor pages is the dreaded NullReferenceException when trying to reference a page component from within the OnInitializedAsync override. Given the following Razor page source, which follows the recommended pattern of displaying a loading indicator while any asynchronous...

Read More

Blog, Programming

Introducing Blazor

Introduction Okay, Blazor isn’t exactly brand new. First announced over three years ago, it’s been in public preview since March 2018. However, with the release of .NET Core 3.1 in December 2019, Blazor Server support in Visual Studio (16.4 and up) is improved and there is also preview support for Blazor WebAssembly. I...

Read More

Featured, Programming

Diagnosing IIS 500 Internal Server Errors

Recently I was tasked with deploying a new version of my company’s website onto a clean Windows Server 2012 host and encountered a rather frustrating issue with the dreaded “500 Internal Server Error” page. Despite there being many articles attempting to cover this error online, none of them addressed my specific case...

Read More

Programming

Debugging Visual Studio Extensions

If you ever need to debug a Visual Studio extension to diagnose problems or just test that it’s behaving how you expected, it’s quite easy to do by taking the following steps: Firstly make sure your extension isn’t currently installed (if you’re working on a newer version or fixing bugs) – if so, uninstall...

Read More

Programming

Implementing simple caching in MVC applications

Whenever I develop a new MVC-based website there is always a question of how best to implement caching so that it’s unobtrusive and fits neatly with the standard Repository pattern without adding too much extra coding requirement on top. I’m going to be using dependency injection (DI) for this example so if your solution...

Read More

Programming

• One Comment

Improving Entity Framework performance by tracking changes manually

Introduction While working on a recent personal project, I had the not-too-unfamiliar pleasure of fighting Entity Framework to try and get some half-decent performance out of a console application that I was using to bulk add and update records based on some external data feeds. It’s often said that EF isn’t really geared...

Read More

Programming

Generating service contract from static WSDL and XSD files

Recently I needed to generate a service contract interface for a third-party client based on their specification. My client would be hosting the service so we would be providing our own WSDL and endpoint, but the service had to conform to the end client’s requirement including which objects would be exchanged. To make this work...

Read More

Programming

• 2 Comments

Converting from Linq-to-SQL to Entity Framework Model First

Recently I switched hosting providers and had to update an existing project to work against a MySQL database instead of SQL Server. After successfully creating the MySQL database and porting over all the data (which turned out to be a major chore and worthy of a post in itself…), I went to update my website …...

Read More
Close

Warning: Use of undefined constant XML - assumed 'XML' (this will throw an Error in a future version of PHP) in /var/www/html/willappleby/wp-content/plugins/wp-syntaxhighlighter/wp-syntaxhighlighter.php on line 1048