
VS Build: d15.6stg.27207.3002
dotnet --info:

I always add xmlns="http://schemas.microsoft.com/developer/msbuild/2003" to the main document Project node, try this as a workaround. Makes /pp: output much cleaner too!
Validate this on d15.6/27401.00 (15.6 Preview 4):
For C# and VB .Net Core project, the IntelliSense can work well.
But for F# .Net Core project, the IntelliSense can't work well.

@Xiu-Li, again, simply add xmlns="http://schemas.microsoft.com/developer/msbuild/2003 attribute, like <Project Sdk="..." xmlns="http://schemas.microsoft.com/developer/msbuild/2003">. This does not affect the build, but makes the XML editor pick up the schema, and enables Intellisense.
In any case, the magic of referring the namespace happens in some VS extension, I doubt the MsBuild repository is the correct place to report the problem. Sorry, I cannot suggest where is the right repository for that. What happens for C# projects is the XML editor extension in Visual Studio is hooked up by some other VSIX extension, which supplies the namespace when sees a namespace-less document with the .csproj extension. Try asking the roslyn team.
@kkm000, thanks very much, after adding xmlns="http://schemas.microsoft.com/developer/msbuild/2003 attribute, enables Intellisense successfully.
I have this issue to. But adding xmlns="http://schemas.microsoft.com/developer/msbuild/2003" to the project node does NOT resolve the issue for me!
I had the same issue. Adding the schema worked for me after restarting Visual Studio (v15.8.1).
I just rechecked, unlike @tom-corwin I really do not get any IntelliSense for my csproj file. Adding the schema does not work, and after restarting Visual Studio it still does not work. After completely reinstalling Visual Studio it still does not work.
What is VERY strange however, is that IntelliSense in the Directory.Build.props works flawlessly!
@couven92 I'm not sure if it will help. But in the XML>Schemas... menu, have you tried removing and readding the local copy of the schema?
@tom-corwin nope, does not help, still no IntelliSense.
I have the same problem with .Net Core Projects. IntelliSense for .csproj files does not work if the project is loaded.
BUT IntelliSense works if you unload the project and then edit the .csproj file.
(VS2017 Enterprise 15.8.3)
dotnet --info:
.NET Core SDK (reflecting any global.json):
Version: 2.1.401
Commit: 91b1c13032
Runtime Environment:
OS Name: Windows
OS Version: 10.0.17134
OS Platform: Windows
RID: win10-x64
Base Path: C:\Program Files\dotnet\sdk\2.1.401\
Host (useful for support):
Version: 2.1.3
Commit: 124038c13e
.NET Core SDKs installed:
2.1.401 [C:\Program Files\dotnet\sdk]
.NET Core runtimes installed:
Microsoft.AspNetCore.All 2.1.3 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All]
Microsoft.AspNetCore.App 2.1.3 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.NETCore.App 2.1.3 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Yes, not repro for F# .Net Core project on VS2017 Enterprise 15.8.3.
+EnrichoReich
The problem persists (multitarget, .NET Standard 2.0), even after:
@gorangrubic
Sorry for my late answer. Yes, I also noticed. After unloading the project you have to close and reopen the solution. Now, if you open the csproj file from the unloaded project Intellisense should work. But if you reload the project Intellisense stop working again.
I have reinstalled VS (15.8.4) with no extensions and created a new dotnet core (ASP.NET core) project but that did not help, Intellisense in csproj file does not work.
After creading a new project the schema parameter in csproj file properties is empty!
Even if I do add the Microsoft.Build.xsd Schema manually or add xmlns attribute suggested by kkm000 Intellisense does not recognize it.
It is frustrating!
Hey,
I did some investigations and found out, if you put your project into a solution folder like

Intellisense for csproj files does not work properly after reloading the solution. This also happens with .Net-Framework projects. I think it is a VS XML-Editor Problem but I'm not sure.
If yxou move the project out of the solution folder and reload the solution Intellisense for csproj file works without problems.
So, this is sad because I like to organize my projects into solution folders. :disappointed:
@EnricoReich: Looks like it, thanks for nailing it down! Unloading a project before editing (i. e. not the shadow-editing with the project still loaded) does not pick up the IS schema either, even though all the right schemata are checked as "use" in the file properties window. But if you copy the file, give it an extension ".xml" and open, then IS works. As if the schema is forced into the XML editor by some Roslyn VS integration component, when the VS is aware (let's say, way too aware in this case) that the file is actually a project file, not just any run-off-the-mill XML document.
If only we find the right team to deal with the issue. I am sure this is not a problem with MSBuild! Let me try to find the folk on GitHub who likely own that part.
Problem still happening for me too at version VS Community 2017 15.8.6 - even when project is unloaded and with xmlns attribute added to
@kkm000, I know there's a repo for ASP.NET Core tooling for VS, but I don't know if there is one just for .NET Core. If there is, that's probably the best place for this issue (i'd assume, anyways)
I described this problem a few weeks ago at the Visual Studio Developer Community website but apparently there is hardly anyone interested in it. Maybe if it gets some upvotes or comments someone will take care of it.
@EnricoReich I gave it an upvote, hopefully they'll fix it sooner rather than later.
@tom-corwin @EnricoReich I also gave it an upvote.
@EnricoReich I found the project I was looking for dotnet/project-system
Here's an issue tracking IntelliSense not working in C# projects: https://github.com/dotnet/project-system/issues/3225
Here's another two hits of this:
https://github.com/dotnet/project-system/issues/3225
https://github.com/dotnet/project-system/issues/4061#issuecomment-434599079
Not repro on VS-Val/d15.9/28230.54 (15.9 preview 5.0). For C#/VB/F# .Net Core project, the IntelliSense can work well.
For my cases:
OS: Win10 Pro 17763, Simplified Chinese
VS: 15.8.8, Simplified Chinese/English
When switching VS to English, IntelliSense works with a simple playground project. When switching to Chinese it does not work.
But it does not work with my customized projects, even in English.
Further information: these projects use Directory.Build.props to import target framework, and VS cannot load them if explicitly set project GUID in solution file.
VS 15.8.8 gives my project files(on which IntelliSense not works) indent=4, while some older version gives 2.
Edit: the cause for my projects should be Solution Directories. When I move a project into root level of solution, it just suddenly works(without reloading).
I can repro this in VS-Enterprise 15.8.9 & 15.9preview5.
OS: Windows 10 Pro [17763.55, 1809], Language: German
VS: 15.8.9 & 15.9preview5 (without additional extensions), Language: English (both)
If I create a project at solution root (in VS) Intellisense for csproj files works as intended. But if I create or drag&drop a project into a solution folder/directory and reload the solution, it does not work e.g. almost no Intellisense for csproj files. Only code completions for CDATA and comments are shown.
Same here as @EnricoReich describes. I actually use a Directory.props file to enforce the following .NET repository structure:
root
鈹溾攢 bin
| 鈹溾攢 Debug
| | 鈹溾攢 netstandard1.3
| | 鈹斺攢 netstandard2.0
| 鈹斺攢 Release
| 鈹溾攢 netstandard1.3
| 鈹斺攢 netstandard2.0
鈹溾攢 obj
| 鈹斺攢 ...
鈹溾攢 src
| 鈹斺攢 ...
鈹溾攢 sample
| 鈹斺攢 ...
鈹溾攢 test
| 鈹斺攢 ...*.Test
鈹溾攢 .gitignore
鈹溾攢 .gitattributes
鈹溾攢 .editorconfig
鈹溾攢 LICENSE
鈹溾攢 README.md
鈹溾攢 AllRules.ruleset
鈹溾攢 Directory.Build.props
鈹斺攢 *.sln
I use dotnet sln add to add projects to the solution which will organise the projects in solution folders that match the actual on-disk file system hierarchy.
Just an FYI, even though I get limited Intellisense in the latest VS 15.9 builds, it still doesn't have any information on None/Content attributes like Pack and PackagePath.
I don't yet know the underlying cause of the problem, but let me share the experience I just had with a customer reporting the same problem in the VS 2019 Enterprise 16.4.5 XML editor, trying to edit a .csproj. Setting the xmlns made no difference to him.
However, when I observed that his system was set to locale 1036 (French - France) and mine is 1033 (English - US), just as an experiment, I zipped up all of my xml\schemas folder and subfolders and shared them with him. He dropped that into his machine, and the IntelliSense is working for him. We haven't yet taken the time to investigate the differences, but it's important to note that this problem may be related to language/locale-specific differences.
It looks like there may be multiple issues reported here. I think the main one was fixed as #2723 for Visual Studio 16.5. I'm going to close this issue, but please don't hesitate to file a new issue if you see problems on 16.5 or higher. Please include details like your OS and Visual Studio versions, language settings, and what you expect to see and actually experience.
VS 2019: I get no intellisense for the importelement but not for the attributes. The importis located directly under Projects
Most helpful comment
Hey,
I did some investigations and found out, if you put your project into a solution folder like
Intellisense for csproj files does not work properly after reloading the solution. This also happens with .Net-Framework projects. I think it is a VS XML-Editor Problem but I'm not sure.
If yxou move the project out of the solution folder and reload the solution Intellisense for csproj file works without problems.
So, this is sad because I like to organize my projects into solution folders. :disappointed: