Matt Johnson-Pint
Matt Johnson-Pint

Reputation: 241959

Why does Visual Studio leave an empty ItemGroup node in the project file?

Removing the empty node doesn't seem to make any difference, so why does VS leave this behind?

Why do I care? Because commits like this are confusing:

enter image description here

Upvotes: 15

Views: 1715

Answers (1)

Drew Noakes
Drew Noakes

Reputation: 311425

Firstly, an empty ItemGroup is benign, just as an empty PropertyGroup is. At worst it's noise in your project file.

Historically, the project file was not really intended for human consumption and only ad-hoc effort was put into keeping it tidy during transformations made by VS.

With the new SDK-style project files, the intent is 100% to have them be human readable and editable. If you see empty groups in VS when using the new project style, it's definitely something the team wants to know about. In such a case, please report a problem and explain in the body that it's for the project system team.

Upvotes: 3

Related Questions