MSBuildSdks icon indicating copy to clipboard operation
MSBuildSdks copied to clipboard

[NoTargets] Why not `<EnableDefaultItems>false</EnableDefaultItems>`?

Open shuebner opened this issue 3 years ago • 3 comments

Why does NoTargets keep any of the implicit includes of the Sdk?

I can see that in #114 resource compilation was disabled. Yet, the other defaults are left enabled.

My assumption was that all implicit includes of Compile, None, EmbeddedResource etc. would be disabled in a NoTargets project.

shuebner avatar Jun 21 '22 11:06 shuebner

Why does NoTargets keep any of the implicit includes of the Sdk?

The main reason is so that some of the items are automatic, just like other SDKs. In my opinion, its rather handy that every item in a project directory is added to the <None /> item group.

I think I left the <Compile /> items on by default thinking you would never place a .cs source file in a NoTargets project directory so it would have no impact. Are you seeing a performance impact of the default items enabled by default?

jeffkl avatar Jun 21 '22 16:06 jeffkl

No impact I know or care about. I was just curious whether this was deliberate and why or an oversight 🙂. I just had to set EnableDefaultItems to false myself.

Consider this issue moot then.

shuebner avatar Jun 21 '22 17:06 shuebner

@shuebner okay, I'm going to leave the issue open for now and if we get enough upvotes we'll consider changing the defaults.

jeffkl avatar Jun 21 '22 17:06 jeffkl