dotnet / dotnet/project-system

<EnableDefaultCompileItems>false</EnableDefaultCompileItems> partially working

Open
#7,002 1 comment 0 reactions 0 assignees View on GitHub
Triage-Investigate
Dominant language
C#
Stars
1k
Forks
415
PR merge metrics
No merged PRs in 30d

Description

**Visual Studio Version**:
VisualStudio 2019 v16.9.0

**Summary**:
The `false` MSBuild property is not completely working. Specifically, using it, in combination with platform specific `` Items, results in filtering platform specific files in some cases but not others.

Sample Project: https://github.com/baskren/VisualStudio.CrossPlatformProjects1.git

In the above solution, there are 8 platform specific Library projects:
![image](https://user-images.githubusercontent.com/2528888/110112642-ffbfa380-7d7f-11eb-8235-8eeeb6bd0f99.png)

For common build properties and items, there is a `Directory.Build.props` file in the same folder as the platform specific projects for the library. It is as follows:
``` xml

true
false

CrossPlatformLibrary1
CrossPlatformLibrary1

Uno0001

bin\$(MSBuildProjectName)
obj\$(MSBuildProjectName)

false
false
$(DefaultItemExcludes);obj/**;bin/**

portable


true






```

Notice the `false` on line 17 (above).

Each platform specific project for the library looks something like this:
``` xml


monoandroid10.0


true
5





```

The below screen shot illustrates the issue:
![image](https://user-images.githubusercontent.com/2528888/110113301-eb2fdb00-7d80-11eb-97d0-3232d77260d7.png)

Notice that some CrossPlatformLibrary1 platform projects (Skia.Gtk, Skia.Tizen, Skia.Wpf, and Wasm, in this example) are correctly filtering where as the other projects (Android, iOS, MacOS, and UWP) are not.

**Steps to Reproduce**:

1. Open the solution found at : https://github.com/baskren/VisualStudio.CrossPlatformProjects1.git

2. In Solution Explorer, examine the platform projects for each platform project in the Library folder

**Expected Behavior**:

Mis-matched platform specific files are filtered out of each platform project (ex: Class1.ios.cs does not appear in the CrossPlatformLibrary1.Android project listing in Solution Explorer

**Actual Behavior**:

Mis-matched platform specific files are **NOT** filtered out of each platform project (ex: Class1.ios.cs, as well as others, appears in the CrossPlatformLibrary1.Android project listing in Solution Explorer
![image](https://user-images.githubusercontent.com/2528888/110114003-f33c4a80-7d81-11eb-88ab-474f7cc1a2b9.png)

**User Impact**:

Low to moderate. Fortunately, the build process IS WORKING. This is a VisualStudio 2019 v16.9.0 issue (it was not happening in last release of version 16.8).

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.