monodevelop icon indicating copy to clipboard operation
monodevelop copied to clipboard

[Ide] Consider MSBuild item conditions in Solution pad

Open mrward opened this issue 4 years ago • 2 comments

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):

  • Handling ItemGroup definitions.
  • Changing visible files in the Solution pad on changing the active configuration.

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

mrward avatar Dec 02 '19 15:12 mrward

@monojenkins backport release-8.4

mrward avatar Dec 02 '19 15:12 mrward

@monojenkins rebase

rodrmoya avatar Jan 03 '20 12:01 rodrmoya