Reducing Build Size

I have been developing a Maui application as a side project and on the whole it has been a fun process. It is still very buggy and there are some pain points however it seems to work. One aspect I haven’t liked is the size of the build artefacts - they are huge if you have multiple projects.

Patrick Smacchia posted an article which mentions a little known file called “Directory.Build.Props” which you can put in the root folder of your solution and it can, among other things, tell the build to use a single “bin” folder for the output. On my project this has saved over 1GB in output!

All you need to do is create the file in the same folder as the “.sln” file and include the following content:

<?xml version="1.0" encoding="utf-8"?>
<Project> 
   <PropertyGroup>
      <BaseOutputPath>..\bin</BaseOutputPath> 
   </PropertyGroup>
</Project>

Links

.NET Build Improvement: Stop Wasting Resources

Related Posts

My most used Obsidian plugins

I have started using Obsidian a lot. One of the things that I really like is the ability to add community plugins to add functionality as required.


Read More

Extending a wifi network with a TP-Link RE650

I had a very unusual setup for the network for my office. The office is situated a floor above and at the opposite end of the house to where the main router is located. A fully wired connection is not an option at the moment due to concrete floors and limited access to roof voids.


Read More

Public/Private keys introduction

I recently had to try and explain to some non-technical colleagues how part of our system works. This involved giving them a very quick overview of public/private key cryptography. So I thought I would summarise it here.


Read More