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

#Edit Upvote here for Unity to do it by default: Unity Issue Tracker - [Mono] .NET 4.7.1 standard/framework .XML 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.

4 Likes

Not true, still missing in Unity 2019.

Bump

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.

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:

2 Likes

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!

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 : NuGet Gallery | 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.

4 Likes

@aybe Easy and effective, thanks!

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.

For any time travelers, this is what helped me for Unity 2020.3.x:

Ye that’s my report. How did it help?

I asked for the report to be changed to “Postponed” that way voting is possible!

Upvote: Unity Issue Tracker - [Mono] .NET 4.7.1 standard/framework .XML files with useful descriptions are missing

I think they put it back on Postponed, I upvoted. Thanks for the info in this thread, it finally got me working.

1 Like

I tried running the >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 asp.net - Error "dotnet : Could not find any project in `C:\**." when running "dotnet add package Microsoft.AspNetCore.Authentication.MicrosoftAccount" - Stack Overflow 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 >dotnet add package NETStandard.Library --version 2.1.0 ?

Nevermind, i didn’t see the option on the right to just download the package.