mono / monodevelop

MonoDevelop is a cross platform .NET IDE
http://www.monodevelop.com
2.84k stars 1.02k forks source link

[Ide] Consider MSBuild item conditions in Solution pad #9407

Open mrward opened 4 years ago

mrward commented 4 years ago

Creating an ASP.NET Core project when .NET Core 3.1 SDK was installed would result in .json files being displayed twice in the Solution pad. .NET Core 3.1 SDK defines .json files twice.

<Content Include="**\*.json" ... Condition="'$(ExcludeConfigFilesFromBuildOutput)'!='true'" />

<Content Include="**\*.json" ... Condition="'$(ExcludeConfigFilesFromBuildOutput)'=='true'" />

Older .NET Core SDKs did not define the Content items more than once. The Condition was not considered when showing files in the Solution pad.

To support conditional files the Solution pad asks the project for its visible files. The project uses the MSBuildEvaluationContext to evaluate the condition to see if the file is visible or not.

Note that conditions on parent ItemGroups are currently not taken into account. Also that visible files are not updated if the active config is changed.

Out of scope for this change (to minimize changes for 8.4):

Fixes VSTS #1005277 Create ASP.NET Core project, open Properties folder, there are two launchSettings.json files.

mrward commented 4 years ago

@monojenkins backport release-8.4

rodrmoya commented 4 years ago

@monojenkins rebase