I just updated my whole code base to the new prerealease version 220.127.116.115-develop and now I try to implement a custom build process with MSBuild (though I am fairly new with the “targets” stuff )
According to this part of the MGCB documentation, I can use
AfterTargets="BuildContent" to do things before or after the MGCB process runs.
So here is what I tried in my .csproj :
<Project Sdk="Microsoft.NET.Sdk"> <PropertyGroup> <TargetFramework>netcoreapp3.1</TargetFramework> <MonoGamePlatform>Windows</MonoGamePlatform> </PropertyGroup> <ItemGroup> <PackageReference Include="MonoGame.Content.Builder.Task" Version="18.104.22.1685-develop" /> </ItemGroup> <Target Name="MyBeforeTarget" BeforeTargets="BuildContent"> <Message Text="MyBeforeTarget Ran"/> </Target> <Target Name="MyAfterTarget" AfterTargets="BuildContent"> <Message Text="MyAfterTarget Ran"/> </Target> <Target Name="IncludeContent" BeforeTargets="PrepareForBuild"> <Message Text="IncludeContent Ran"/> </Target> </Project>
Unfortunately, none of these targets seem to be called as long as
MonoGame.Content.Builder.Task is in the project. Only the MGCB task runs during the build and I don’t see any other message in the Build Output. Am I missing something?