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

Should I edit my photos?

I am not a photographer. However I like thinking that I can take a good photograph.


Read More

Rebecca purple

The community for the CSS-Next repository recently had a vote to decide on a new official logo. The colour chosen for the new logo was rebeccapurple. This colour was introduced to the CSS specification in 2014.


Read More

The alternative bucket list approach to life

I have never formally made a bucket list. Sure, there are things I would love to do and some more than others but I have never written anything down.


Read More