dotnet / dotnet/project-system
<EnableDefaultCompileItems>false</EnableDefaultCompileItems> partially working
- 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:

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:

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

**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
Assessment
This issue has not been assessed yet.