Notice (2018-05-24): bugzilla.xamarin.com is now in
Please join us on
Visual Studio Developer Community and in the
Mono organizations on
GitHub to continue tracking issues. Bugzilla will remain
available for reference in read-only mode. We will continue to work
on open Bugzilla bugs, copy them to the new locations
as needed for follow-up, and add the new items under Related
Our sincere thanks to everyone who has contributed on this bug
tracker over the years. Thanks also for your understanding as we
make these adjustments and improvements for the future.
Please create a new report for Bug 57109 on
Developer Community or GitHub if you have new
information to add and do not yet see a matching new report.
If the latest results still closely match this report, you can use the
In special cases on GitHub you might also want the comments:
GitHub Markdown with public comments
1) Create a new .NET Standard project.
2) Edit the .csproj so it has:
3) The Class1.cs file in the Solution window will be removed.
4) Add the Class1.cs file back by right clicking the project and selecting Add Files.
5) See the Class1.cs file is added into the .csproj:
<Compile Include="Class1.cs" />
6) The Class1.cs file should also be shown in the Solution window.
7) Type say 'using ' into the top of the Class1.cs file.
See code completion for usings.
See no code completion anywhere in the file. The type system seems to be unaware of the classes in the project.
The problem seems to be that when EnableDefaultCompileItems is set to false the EvaluatedItems for the project contains the Class1.cs file as both a None item and a Compile item. The TypeSystem calls Project.GetSourceFilesAsync which returns the None item first followed by the Compile item. The TypeSystem adds the None item to its list of documents and then when it tries to add the Compile item it finds the file already exists so ignores it. So the Class1.cs file is treated as a None item by the type system.
A workaround is to use EnableDefaultItems instead which disables all default items. This avoids the default None items.
This looks like a bug in the sdk targets. The Compile items should be removed from the None items if EnableDefaultCompileItems is false. There seems to have been a fix made for this but it was closed: