As far as I can tell no one else in the world is having this problem. I already asked this on the discord and on reddit and people don’t have any idea… But I’ll throw it into the void and see if anything jumps out at the experts here.
So here’s the deal, every time I build (using Visual Studio’s CTRL+SHIFT+B or F5) with zero code changes, one of two things happens:
- All of my Content gets rebuilt. Evidenced by the output showing the paths of each item of my Content with none of them prepended with “Skipped”
- Most of the Content gets skipped, but then the sound files (.ogg files) get rebuilt. This is basically the same as above because my content consists of mostly pngs and oggs, the pngs are really fast regardless but the oggs are agonizingly long. The only real difference is the output is slightly different.
A few weeks ago the “normal” behavior used to be that I’d start up my computer after a cold boot and the first build would need to rebuild Content (weird, right?) but then subsequent builds wouldn’t (except for random one-off times where it would?) this didn’t really get in my way so much so I didn’t care. But about a week ago it started happening every. single. build and it really sucks!
Some things that might make my environment special that could (maybe??) be the cause:
- (I don’t think the IDE is a factor but…) I’m running Visual Studio 2019 in Windows 10, although Jetbrains Rider does the same thing (I actually first started noticing this problem when I was using Rider).
- I’m using NuGet to get MonoGame.Framework.DesktopGL at 22.214.171.1241, as well as the MonoGame.Content.Builder.Task at the same version.
- The main csproj I’m building is straight from the DesktopGL template.
- Build a DesktopGL project that has most of the Content, as well as a Shared Project that has some of the Content in a mirrored file structure, the resulting build output contains one file structure with xnbs from both.
- I’m also using a csproj project reference for the Game Engine, which is also a DesktopGL project.
- I’m using MonoGame.Extended (I highly doubt that has anything to do with it, just being thorough)
- This isn’t just this one game project. I’ve had this same bug happen with several projects (with similar topologies to this one, so maybe that’s a hint)
Some other things I’ve learned:
- As far as I can tell MGCB is innocent in all this. If I build straight from the MGCB GUI it’s able to detect what’s already been built and skip over it just fine.
- I poked around in the build targets (I’m not an msbuild expert, everything I know about msbuild I learned so I could debug this problem) and I found the actual MGCB commands that were run, and if I run them in the command line they do the right thing and skip over built stuff.
Diagram of my project topology
This has been the biggest motivation killer for me. I miss my 2 second builds and I really don’t want to need to do build finaggling to just get the basic functionality that’s supposed to already come out of the box.