I have a simple hello world console app with top level statements as follows:
Console.WriteLine("Hello world");
I would like to experiment with automatically executing targets before the build process, so I edited the CSPROJ file as follows;
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>
<Target Name="BeforeBuild" BeforeTargets="Build">
<Message Text="BEFORE BUILD TARGET" Importance="high" />
</Target>
</Project>
I tried dotnet build MyProj.csproj
with verbosity levels all the way up to diagnostic
. However I can’t get the message text to appear.
What am I doing wrong here?