Compile item group not populated without warning message.
Was wrongly titled "EnableDefaultCompileItems forced to false without warning message."
While defining a custom Sdk that is a wrapper around the standard Microsoft.NET.Sdk, I came to a situation where I defined properties and items early in the process, before the import of the standard Sdk.
I know now this is an error and items must be defined later in a target.
Because of unrelated properties/items, all of a sudden the project does not compile anymore.
The bug is to have an empty Compile item group without informing the user that it will not be populated.
Clone the repo
cd Source\SomeProject
dotnet build
result:
Determining projects to restore...
All projects are up-to-date for restore.
ProjectBeforeRestore: EnableDefaultCompileItems true
ProjectBeforeRestore: EnableDefaultItems true
C:\Scal26\DotNet.MSBuild.Issue.13566\Source\SomeProject\SomeProject.csproj(13,9): warning : ProjectBeforeRestore: Compile ItemGroup is empty
CSC : error CS5001: Program does not contain a static 'Main' method suitable for an entry point [C:\Scal26\DotNet.MSBuild.Issue.13566\Source\SomeProject\SomeProject.csproj]
Build FAILED.