-
Notifications
You must be signed in to change notification settings - Fork 866
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ArgumentException: Illegal characters in path #5432
Comments
On further inspection, rolling back to the previously working version (2.43.4) and a previous commit on my repo that is confirmed to have successfully generated docs it fails with the same error. So this must be due to something that has changed with the .NET build tools? Edit: I can also confirm the same error occurs when using the Edit 2: Similar to #4952, if I apply the below patch and generate metadata on my own, I can then successfully generate the HTML site with an existing build of DocFx. https://gist.github.com/Sharparam/f73727aa916389266ac9060dac629f3f (The diff is against v2.48.1, the change is to escape I can't do the whole flow with my self-built copy as, again similar to the linked issue, I get the below message after generating metadata:
|
I cannot tell why the filename is like this. Usually, it should be
For this, run |
It seems to be related to at least a few things:
Looking at the site I get generated (not using static TOC so has to be served with For In the var fields = typeof(Devices).GetFields(BindingFlags.Static | BindingFlags.Public).Where(p => p.FieldType == typeof(Guid)); The predicate function used in the I don't know enough about C# internals to know what all this really means, but maybe it will be useful for further investigation. |
After updating to DocFx 2.49, I'm now receiving a different error:
Unclear if this is still related to the same cause as above, will need to investigate. Edit: This seems to actually be this issue: #5536. If that issue is fixed the root issue of this issue may still be present, however. |
@superyyrrzz I have created this MWE to produce the error: namespace DocFxIssueTest
{
using System.Threading.Tasks;
public static class TestClass
{
public static async Task<int> TestAsync()
{
await Task.Delay(50);
return 42;
}
}
} If you try to generate docs for this class (targeting either .NET Standard 1.3 or latest 2.1), DocFx will produce the errors described above. So this seems to affect any code that uses async functionalities? But if so, it should be affecting many more people than just me. Can you test this and see if you get the error yourself? Or could this be something unique to my setup? |
Still an issue as of latest 2.55 version. However, it seems the metadata generation now works properly for netstandard2.1 projects. The "Illegal characters in path" appears when I run DocFx against a netstandard1.3 binary, but not against a netstandard2.1 binary. Does this bring any clarity? |
It's currently broken for .NET Standard 1.3 projects that use async code dotnet/docfx#5432
2.58.2 - same error. at System.IO.Path.CheckInvalidPathChars(String path, Boolean checkAdditional) |
Ok, I've got the source. Reflector tries to get all public members. Including like that MyNamespace.MyClass.<_name>e__FixedBuffer (auto-gen class for these things https://docs.microsoft.com/en-us/dotnet/csharp/language-reference/unsafe-code#fixed-size-buffers ). And it is failed when ExtractMetadataWorker call Path.Combine. I believe need more filtering for extracted metas. |
Getting the same error with DocFX 2.58.9:
I also tried it with the latest version (v2.70.4), where the error is more useful because it mentions the name of the file it's trying to generate:
As mentioned by @mikasoukhov, this seems to be caused by the angle brackets ( public unsafe string Name
{
get
{
fixed (short* name = Name0)
{
return new string((char*)name);
}
}
} DocFX tries to create a yml file for this auto-generated struct using its name, but fails because angle brackets are not allowed in Windows file paths. As far as I know, Linux doesn't have that same restriction which explains why the FlaxDocs GitHub action works without issue, but I (on Windows) can't build the documentation locally. Cloning the FlaxDocs repo and running the Since this isn't an issue on Linux, resolving it isn't particularly urgent for this project, but I was hoping to update the DocFX version and then make some other changes, and not being able to build the docs locally to ensure I haven't broken anything makes that difficult :/ |
Operation System:
Windows 10
DocFX Version Used: 2.48.1
Template used:
default
Steps to Reproduce:
docfx docs/docfx.json
from the repository root.Expected Behavior: DocFx generates documentation.
Actual Behavior: DocFx fails with the following output:
Additional info:
The stack trace in the output doesn't say much, but after downloading the source for DocFx v2.48.1 and debugging it I see that the path it complains about is
Colore.ColoreProvider.<CreateNativeAsync>d__2.yml
. I don't know why it generates such a path though (the angle brackets are forbidden in file paths on Windows).Documentation generation has worked in the past, so something must have changed, but unsure what. I'll see if some older versions work.
The text was updated successfully, but these errors were encountered: