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

Random Posts

Last House Standing

We had a guest speaker at church on Sunday, the son-in-law of our pastors. He spoke on the subject of “Last House Standing” - based on Matthew 7:24-27, the wise and foolish builders.


Read More

Stunning nature photographs

These nature photos are absolutely stunning. Some people have a gift for photography … and I am not one of them.


Read More

Watch an octopus dreaming

Obviously we have no idea whether the interpretation in the video is correct however I love they way the octopus changes colour and shape as it “dreams”.


Read More