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

Don't let status change the conversation

I am probably like most people in that when I meet someone who I deem to be important the way I deal with them changes. It introduces a more reserved interaction with more careful responses.


Read More

Assumptions can be dangerous

There is a quote “A backup is not a backup unless you have recently performed a restore from it”; I got to find this out the hard way.


Read More

Smart glasses you might actually wear

Intel have just announced a new set of smart glasses that don’t look stupid. Admittedly the functionality is a lot more limited that other offerings however these look a lot more normal than them. It provides very limited functionality to display a small red image in the lower part of the wearers vision. Cleverly it also disappears when the user is not looking down.


Read More