I hope there is a simple answer to my question. I have updated a .NET 4.8 project to .NET 8.0. Now my project file is diffrent. That's clear. But how can I start my target now?
In .NET 4.8 I had one section:
<PropertyGroup>
<BuildDependsOn>
$(BuildDependsOn);
LangResources;
</BuildDependsOn>
</PropertyGroup>
And after this my definition for the target:
<Target Name="LangResources" Inputs="@(Resource)" Outputs="@(Resource -> '$(OutDir)%(Filename).resources')">
<Message Text="Running ResourceCompiler... @(Resource)" Importance="high" />
<GenerateResource Sources="@(Resource)" OutputResources="@(Resource -> '$(OutDir)%(Filename).resources')">
<Output TaskParameter="OutputResources" ItemName="Resources" />
</GenerateResource>
<Message Text="Generated Resources... @(Resources)" Importance="high" />
</Target>
The update to .NET 8.0 with Visual Studio moves the "BuildDependsOn" section to the first <PropertyGroup> section and leaves the <Target> section unchanged. But the target is not called. No converting from the resx files to resources and also no logging. There is also no error message in the output section.
How do I call targets in the project file with .NET 8.0 like in .NET 4.8?
BuildDependsOnreturns the targets doc page . The format is simplified, not completely new.<Target Name="Build" DependsOnTargets="Resources">means theBuildtarget depends on theResourcestarget, so when you calldotnet buildthe resource files will be built as well.