Search Unity

  1. Unity 6 Preview is now available. To find out what's new, have a look at our Unity 6 Preview blog post.
    Dismiss Notice
  2. Unity is excited to announce that we will be collaborating with TheXPlace for a summer game jam from June 13 - June 19. Learn more.
    Dismiss Notice

Feature Request IntelliSense descriptions for .NET Standard System classes

Discussion in 'Code Editors & IDEs' started by Daniel-F, Mar 2, 2023.

  1. Daniel-F

    Daniel-F

    Joined:
    May 15, 2013
    Posts:
    26
    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.
     
    van800 likes this.
  2. CodeSmile

    CodeSmile

    Joined:
    Apr 10, 2014
    Posts:
    6,515
    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.
     
    Daniel-F likes this.
  3. Daniel-F

    Daniel-F

    Joined:
    May 15, 2013
    Posts:
    26
    Sounds well worth considering, but it still makes sense for Unity to have good default support for common IDEs.
     
  4. Daniel-F

    Daniel-F

    Joined:
    May 15, 2013
    Posts:
    26
    @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?
     
    Last edited: Mar 2, 2023
  5. CodeSmile

    CodeSmile

    Joined:
    Apr 10, 2014
    Posts:
    6,515
    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. :)
     
  6. Daniel-F

    Daniel-F

    Joined:
    May 15, 2013
    Posts:
    26
    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.
     
  7. Daniel-F

    Daniel-F

    Joined:
    May 15, 2013
    Posts:
    26
    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.
     
  8. Daniel-F

    Daniel-F

    Joined:
    May 15, 2013
    Posts:
    26
    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.