IntelliSense descriptions for .NET Standard System classes

I’ve seen a ton of questions about IntelliSense not working with Unity classes, but in my case those were working fine while standard .NET System classes, methods and properties were all missing their IntelliSense descriptions. For example, when hovering over “string” in a normal C# project, Visual Studio will pop up with “System.String: Represents text as a series of UTF-16 code units”, but in a Unity project it’d just say “System.String”.

After a lot of troubleshooting with different Unity and Visual Studio versions and packages it turned out the problem is just that Unity points VS to its own copy of netstandard.dll but doesn’t have a corresponding copy of netstandard.xml with the IntelliSense data. If you can find an appropriate netstandard.xml (e.g. you might have it under Program Files\dotnet\packs\NETStandard.Library.Ref\2.1.0\ref\netstandard2.1\netstandard.xml ) and copy it to your *[Unity editor]\Editor\Data\NetStandard\ref\2.1.0* folder it solves the problem (when using .NET Standard 2.1 at least – the steps may be slightly different for other .NET versions).

This really seems like something that should work by default though.

1 Like

Many years ago I switched over to Rider and the most consistent thing with it was that I never ever again had any issues with „Intellisense“ not working, whereas it was frequently happening with VS. I can even tell it to ignore, for example, System.Numerics.* because that also has Vector3 etc classes.

1 Like

Sounds well worth considering, but it still makes sense for Unity to have good default support for common IDEs.

@John_MSFT Any opinion on the best way for this to be resolved? Should Unity just include the .xml file with the Unity editor, or is there a better way?

Generally speaking (may not apply to the issue you described), it‘s Microsoft’s job to support Unity well. That‘s a niche thanks to (probably deprioritization) by MS (there‘s more money in business apps for them, gaming is just a niche for them) that Rider jumped onto full force because for them, that‘s another meaningful attack vector, one niche at a time.

Sometimes my sentences aren‘t the easiest to read, sorry. :slight_smile:

This issue seems to be caused by Unity’s use of a customised and incomplete copy of Microsoft’s framework files installed to the Unity editor folder by the Unity installer itself though.

This may be obvious but just adding that currently to keep the problem resolved, netstandard.xml needs to be copied into *\Editor\Data\NetStandard\ref\2.1.0* for every Unity editor version/after every Unity update.

Just noting that Unity confirmed this issue but classified it as Will Not Fix as they have a new MSBuild system planned for the future.

Curiously this worked for me only for my main assembly and not for code in my editor assembly. Do you have any guesses about why that might be?