docfx
docfx copied to clipboard
Invalid cref value "!:XElement"
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:
- Create some triple slash comment with a cref to an XElement.
- 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
Can Visual Studio find this type, or also complain about a warning?
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.
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
?
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?
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.
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.
I verified @tparviainen his solution and worked for my project. I think this van be closed.
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 ''.
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">
.