docfx icon indicating copy to clipboard operation
docfx copied to clipboard

Invalid cref value "!:XElement"

Open Weasy666 opened this issue 5 years ago • 9 comments

Operation System: (Windows or Linux or MacOS) Azure Pipelines...i guess Windows.

DocFX Version Used: Don't know what version is used by MixedReality Toolkit.

Steps to Reproduce:

  1. Create some triple slash comment with a cref to an XElement.
  2. Build docs with this config

Expected Behavior: XElement will get referenced.

Actual Behavior: Invalid cref value "!:XElement" found in triple-slash-comments for AddCapability, ignored.

For more details you can take a look here https://github.com/microsoft/MixedRealityToolkit-Unity/pull/5891#discussion_r324784448

Weasy666 avatar Sep 17 '19 13:09 Weasy666

Can Visual Studio find this type, or also complain about a warning?

superyyrrzz avatar Sep 20 '19 03:09 superyyrrzz

There is no problem in Visual Studio. The type is a regular Microsoft type XElement. If you take a look at the MixedReality Toolkit link you can see that the error does not only occur for XElement but also for XAttribute and XName. So i guess there is maybe a general problem with the System.Xml.Linq Namespace.

Weasy666 avatar Sep 20 '19 06:09 Weasy666

I had a peek at the repo, but did not find any existing .csproj/.sln to help me see its behavior in Visual Studio. BTW, have you tried the full name System.Xml.Linq.XElement?

superyyrrzz avatar Sep 20 '19 09:09 superyyrrzz

No, i haven't tried that. I'm a first time contributer to that project so i'm not in a position to try that. But maybe @wiwei can try?

Weasy666 avatar Sep 20 '19 10:09 Weasy666

This issue has been automatically marked as stale because it has not had recent activity. It will be closed in a week if no further activity occurs.

stale[bot] avatar Dec 19 '19 11:12 stale[bot]

I'm seeing similar issue with my .NET Standard assembly, however I also found the workaround for this issue. Here are the repro steps:

git clone https://github.com/tparviainen/clashofclans.git clash1
cd clash1/docfx
docfx

That generates several warning messages about Invalid cref value "!:System.ArgumentException" found in triple-slash-comments.

If you instead do next steps you do not see those warning messages:

git clone https://github.com/tparviainen/clashofclans.git clash2
cd clash2/docfx
dotnet build ../src/ClashOfClans/ClashOfClans.csproj
docfx

So it seems that if the component is first compiled and after that the documentation is generated by DocFX the issue is not present.

tparviainen avatar Dec 21 '19 12:12 tparviainen

I verified @tparviainen his solution and worked for my project. I think this van be closed.

koffie avatar Feb 05 '20 09:02 koffie

In my case, a wrong target framework configured in docfx.json. I copied it from a 4.7.2 project, but the new one had netstandard2.0. But I additionally got the warning The "ResolvePackageAssets" task failed unexpectedly. NuGet.Frameworks.FrameworkException: Invalid framework identifier ''.

martinoss avatar Jul 16 '20 15:07 martinoss

For me the solution was to change the name in the cref to a full name. E. g, instead of <exception cref="ArgumentNullException">, I changed to <exception cref="System.ArgumentNullException">.

arnonax-tr avatar Sep 08 '22 08:09 arnonax-tr