• Save Blushes with Git Hooks

    We’ve all done it - we’ve committed a file, pushed it to the repository and it’s broken the build …. I know, shock, horror huh!?

    Now I’m not suggesting that experienced developers are committing code that doesn’t even build - I mean, we all check that much right ….. right? But do we always remember to run the unit tests?

    No, we don’t, and what happens next - we have to run the tests locally, find the issue, fix it and then go through the cycle again. While you make be able to squash these ‘fixing build’ commits out of the history but that build failure will always be there (unless you’re the DevOps admin of course).

    But what if there was a way that you could avoid having to remember to do these simple, but easily forgotten, tasks. Well, that’s where git hooks come in.

    Read more
  • Spurious Sockets Exception reported by Sentry

    While finishing off the migration of my Smite Scoreboard app to MAUI and having completed the bulk of the work I turned my attention to replacing the soon-to-be retired App Center for a suitable alternative capable of capturing exceptions and providing enough information to investigate them effectively.

    After reviewing a number of alternatives I opted for Sentry, mainly because of the presence of a decent free tier that offered the basic features I require with decent data retention policy.

    After configuring a project on my shiny new Sentry account, adding the required initialisation code to the MAUI project and replacing all the AppCenter references it was time to try it out …. and that’s where the trouble started.

    Read more
  • Deploying and Debugging MAUI Apps to Older iOS Devices with Latest Xcode

    While migrating a clients application from Xamarin.Forms to MAUI there was a requirement to test it on older iOS devices such as an iPhone 6s. Now that’s not really a big issue, I happened to have one in my ‘test phone’ collection that hadn’t been recycled or handed out to a family member who had dropped their own phone in the toilet.

    Getting the phone charged and booted was the easy part - getting it connected to my MacBook Pro so that I could deploy and debug the application to it required a little bit more effort, but not too much as it turned out.

    Read more
  • Dynamic AppShell Items in MAUI

    I’m currently working on a handful of Xamarin to MAUI migration projects with most of them using the AppShell navigation framework built-in to Xamarin.Forms - something I previously found a little clunky.

    I’m sure most phone users are familiar with the concept of the AppShell even if they don’t know it, but basically it provides a slide out menu along with the good old ‘hamburger’ button and swipe gestures to open and close it. With the menu open a number of menu items are presented for the user to select to navigate around the app and/or invoke operations such as logging in or out.

    And therein lies the rub for both Xamarin and MAUI as out of the box the AppShell doesn’t appear to provide an obvious, clean mechanism to dynamically show or hide items based on state within the app, e.g. whether a user is logged in or not so that the appropriate menu options can be displayed.

    The existing applications I’m working with had gotten around this shortcoming in slightly different ways which involved some form of ‘Global State’ class or methods being added to the App.xaml.cs class which required various ugly casts dotted around the app to call them. Surely there had to be a better way than this.

    Read more
  • Configure Default Build Action for all items in a Folder

    How many times have you added an ‘non-content’ file like a SQL script to a folder and forget to set the required build action?

    Well today I resolved this issue once and for all in two projects I’m currently working on with a simple update to the respective csproj files.

    Read more