I’m using 3.8.5preview2 and have switched to the content builder project to build my content (I followed the instructions from the docs page), and so far it’s great compared to the old tool aside from the fact that it only runs when building the project. If, for example, I change an asset, and then hit F5 in visual studio to run the project, it won’t actually run the content builder if no changes were made to the game project. I have to manually right-click, build/rebuild on the game project for it to run, which is a little bit annoying.
How can I make it so the content building happens every time I start up the game, even if it doesn’t rebuild the game project?
This is a bug in Visual Studio not honoring the “new” build system, even when opening a folder based project.
Try runing dotnet restore and dotnet build then `dotnet run` run the project.
Did you update the MSbuild target to use the correct BeforeTargets value? It should be using BeforeCompile not BeforeBuild as it was in the initial release.
<Target Name="BuildContent" BeforeTargets="BeforeCompile">
That doesn’t seem to fix it. The issue is when I run the game, it will compile it the first time, but unless I change the code, running it again won’t recompile it, even if I change an asset. The main game project doesn’t track any changes made to the assets.
You can for now add <DisableFastUpToDateCheck>true</DisableFastUpToDateCheck> to your project and see if that helps.
Note that the new templates for preview.3 have been improved, so check the Migration Instructions for details on how to update (it also includes information for the forthcoming update too).
The template, by default always runs the content builder each time you run, even if you have not changed any code. If the content has not changed, it will skip compiling (as everything is cached), you can see it running in the terminal with the messages (Starting Content Builder, Content Builder Finished).
Just tested with the latest.
1 Like