Search Unity

  1. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Feedback Missing NET/C# descriptions + Workaround to make your life better

Discussion in 'Editor & General Support' started by Kamyker, Nov 6, 2019.

?

Do your NET/C# descriptions show up?

  1. Yes, using Windows

    2 vote(s)
    6.9%
  2. No, using Windows

    23 vote(s)
    79.3%
  3. Yes, other platform

    0 vote(s)
    0.0%
  4. No, other platform

    4 vote(s)
    13.8%
  1. Kamyker

    Kamyker

    Joined:
    May 14, 2013
    Posts:
    1,084
    #Edit Upvote here for Unity to do it by default: https://issuetracker.unity3d.com/is...ml-files-with-useful-descriptions-are-missing
    ---

    I've noticed something interesting. Net dlls provided with Unity installation in for ex.
    C:\Program Files\Unity\Hub\Editor\2019.2.11f1\Editor\Data\MonoBleedingEdge\lib\mono\4.7.1-api
    don't include XML files and thus all VERY useful descriptions are missing in Visual Studio. Because of that I used to google every single time I wasn't sure how one of function works. For example just now I was checking if
    File.Move
    will safely move my file if destination file already exists. Unity shows only this:


    It seems that this is very easy to fix simply copy over all .xml files from
    C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.7.1
    (If u don't have them simply install Microsoft .NET Framework Developer Pack - link to 4.7.1v) to Unity folder mentioned at the top.

    Restart Visual Studio to get this:


    Even better, select Move click F12 for even more info:


    Answer to my question is right there
    "T:System.IO.IOException:
    The destination file already exists."


    Btw Windows platform.
     
    Last edited: Apr 7, 2022
    Saniell, Endahs and aybe like this.
  2. Kamyker

    Kamyker

    Joined:
    May 14, 2013
    Posts:
    1,084
    Not true, still missing in Unity 2019.

    Bump
     
  3. ThatOneDudeFromThePlace

    ThatOneDudeFromThePlace

    Joined:
    Apr 1, 2018
    Posts:
    4
    I'm having the same issue on 2019.3.1f1. Unfortunately adding the xml files doesn't work like it has in the past. It's pretty sad this is still an issue. This problem dates back to 2018 at least.
     
  4. Kamyker

    Kamyker

    Joined:
    May 14, 2013
    Posts:
    1,084
    Just tried again and it still works for me in Unity 2019.3.3:


    I'm using net standard, downloaded xml from https://www.nuget.org/packages/NETStandard.Library/ (change .nuget extension to .zip and unpack).

    To find the location of .dll being used by unity simply click on the "WriteAllText" then F12 then on top of the file you get:
     
  5. ThatOneDudeFromThePlace

    ThatOneDudeFromThePlace

    Joined:
    Apr 1, 2018
    Posts:
    4
    I was definitely putting the xml files in the wrong place (I was putting them in 4.7.1 because that's what the csproj file was referencing, but its actually using .net standard 2.0 like yours is). Thanks for the reply!
     
  6. Kamyker

    Kamyker

    Joined:
    May 14, 2013
    Posts:
    1,084
     
  7. aybe

    aybe

    Joined:
    Feb 20, 2019
    Posts:
    53
    Amazing, for .NET Standard only a single xml is necessary, netstandard.xml.

    I've put it in C:\Program Files\Unity\Hub\Editor\2020.2.0b7\Editor\Data\NetStandard\ref\2.0.0\netstandard.xml and it worked instantly.

    XML file from here : https://www.nuget.org/packages/NETStandard.Library/2.0.0

    That's the closest you'll get, Unity is 1.0.25519.3 and Nuget is 1.0.25519.0.
     
    Endahs, JKoala and RedBambooLeaf like this.
  8. RedBambooLeaf

    RedBambooLeaf

    Joined:
    Mar 22, 2020
    Posts:
    2
    @aybe Easy and effective, thanks!
     
  9. RoyBarina

    RoyBarina

    Joined:
    Jul 3, 2017
    Posts:
    98
    I can't get my Linq extension methods to show their description in VS2022 no matter your solutions.. they still show up in the metadata (F12) so they are surely there.
     
  10. Endahs

    Endahs

    Joined:
    Sep 16, 2014
    Posts:
    94
  11. Kamyker

    Kamyker

    Joined:
    May 14, 2013
    Posts:
    1,084
  12. Kamyker

    Kamyker

    Joined:
    May 14, 2013
    Posts:
    1,084
  13. Endahs

    Endahs

    Joined:
    Sep 16, 2014
    Posts:
    94
    I think they put it back on Postponed, I upvoted. Thanks for the info in this thread, it finally got me working.
     
    Kamyker likes this.
  14. Arthur_Gentz

    Arthur_Gentz

    Joined:
    Jan 11, 2021
    Posts:
    22
    I tried running the
    Code (CSharp):
    1. >dotnet add package NETStandard.Library --version 2.1.0
    command from my unity project as the working directory (J:\Unity Engine\Unity 2022\Dummy Projects\BoidExperiments\).
    But i got the following error:
    'Could not find any project in 'J:\Unity Engine\Unity 2022\Dummy Projects\BoidExperiments\'.
    So i looked around and found this https://stackoverflow.com/questions...find-any-project-in-c-when-running-dotnet-add thread on stackoverflow. Which confused me further.
    So my question is, what should the working directory be, and what should the 'project' argument be to
    Code (CSharp):
    1. >dotnet add package NETStandard.Library --version 2.1.0
    ?
     
  15. Arthur_Gentz

    Arthur_Gentz

    Joined:
    Jan 11, 2021
    Posts:
    22
    Nevermind, i didn't see the option on the right to just download the package.